Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

This is one of the most commonly used data-structures that we use in Javascript. It’s a dictionary.

It’s used as part of JSON - JavaScript Object Notation.

We can specific Javascript objects literally:

var Cars = {type:"Fiat", model:"500", color:"white"};

Javascript object values can be anything can be stored in a Javascript variable - such as a Javascript function i.e.:

var APPcommands ={
   home : function(X) { console.log("Hello home "); }
};

It iterate through a Javascript object you can use:

for (var Car in Cars) {
  console.log(Car, Cars[Car]);
}

See https://www.w3schools.com/js/js_objects.asp

  • No labels