Last active
February 25, 2017 19:37
-
-
Save Dosant/bf916b024b5fcba81600906f2dba459b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
person['firstName'] // 'John' | |
person.firstName // 'John' | |
obj.first-name // Нельзя | |
obj['first-name'] // 'John' | |
flight.airline.number // 815 | |
flight['airline']['number'] // 815 | |
// Если имя поля динамическое: | |
var key = 'firstName'; | |
person[key] // 'John' | |
person.key // Будет искать поле с именем 'key' - такого поля нет - вернет undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment