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]
object.variable


Console.log- Can separate parameters with commas and it will concatenate them:
console.log(prop, ': ', shanghai[prop]);


Comments

Popular posts from this blog

Code Wars: Data Reverse (6 kyu)

Code Wars: longest_palindrome (6 kyu)

Code Wars: Find the odd int