object define javascript code example
Example 1: js object
let car = {
name: "BMW",
colour: "black",
year: "2020",
owner: {
names = ["Andy" , "Steve" , "Tony" ]
}
};
Example 2: create object javascript
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) ;