Javascript – The Good Parts: Object
After Javascript: Grammar now it’s time for Object. Simple types of JavaScript are Numbers Strings Booleans null Undefined All others are Objects Simple Object:
1 2 3 4 5 6 7 | var dentist = { 'first-name' : 'Sajjadul', 'last-name' : 'Robin', 'age' : 30 }; |
Retrieval:
1 2 3 | dentist['first-name'] ;// Sajjadul |
1 2 3 | dentist.age; // 30 |
If a key does[…]