objects javascript

JavaScript
person = {
    'name':'john smith'
    'age':41
};

console.log(person);
//this will return [object Object]
//use
console.log(JSON.stringify(person));
//insteadvar obj = {
  prop1: 5,
  obj2: {
    prop1: [3, 6, 3],
    prop2: 74,
    prop3: {
      str: "Hello World"
    }
  }
};

console.log(obj.obj2.prop3.str); //output: "Hello World"let obj = {
// fields
  name:"value",
  num: 123,
//methods
  foo: function(){}
  
}var	person = {
	first_name : "Marty",
  	last_name : "Mcfly",
	born : 1968,
	died : 1933,
    lovers: ["Jennifer Parker","Baines McFly"]
};var obj = {my:"sql",  nice:[69, 420]};

obj.my //returns the string "sql"
obj.nice //returns the array [69, 420]function Dog() {
  this.name = "Bailey"; 
  this.colour = "Golden"; 
  this.breed = "Golden Retriever";
  this.age = 8;
}
Source

Also in JavaScript: