Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- toucan = {
- lifespan: 20, // property values can be any type...
- classification: { // ...including another object
- family: 'ramphastidae',
- genus: 'ramphastos',
- species: 'sulfuratus'
- },
- 'call': 'croak' // quotes usually optional on property name
- };
- toucan['lifespan'] // => 20
- toucan.lifespan // shortcut when no syntactic ambiguity
- toucan.classification.genus // => 'ramphastos'
- toucan.classification['species'] // => 'sulfuratus'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement