TeamTreeHouse: Objects and Console.log notes
Objects
If accessing object property
using a variable, can do it only through bracket notation since if using dot
notation, it would looking for a key by the variable name. An example of this
scenario would be when using a for in loop with an object.
object[variable]
Console.log- Can separate
parameters with commas and it will concatenate them:
console.log(prop, ': ', shanghai[prop]);
Comments
Post a Comment