create object javascript

JavaScript
let obj = {
// fields
  name:"value",
  num: 123,
//methods
  foo: function(){}
  
}// Object literals are defined using the following syntax rules:
// A colon separates property name from value.
// A comma separates each name-value pair from the next.
// There should be no comma after the last name-value pair.

// If any of the syntax rules are broken, such as a missing comma or colon or curly brace,
// an error will be thrown.

var myObject = {
    sProp: 'some string value',
    numProp: 2,
    bProp: false
};
var car = {type:"Fiat", model:"500", color:"white"};
 var a = {
name: "aakash",
  age:30
}let address = {
    firstname: "harry",
    lastname: "potter",
  	company: "none",
    country_code: "AU",
	city: "QLD",
	postcode: "123",
    region: "ACT",
    street: "1234 Shouth lake",
    telephone: "1234567"
};

/* to iterate this */
Object.keys(address).forEach((key) => {
	console.log(address[key])
})let voleur = {
     action     : () =>console.log ('Coup de dague fatal') ,
     crie      : ('pour la horde!!!!') ,
     coupfatal :()=> console.log ('coup dans le dos')

}

voleur.action() ;
voleur.coupfatal() ;
console.log(voleur.crie) ;

Source

Also in JavaScript: