object creating in javascript code example
Example 1: objects javascript
function Dog() {
this.name = "Bailey";
this.colour = "Golden";
this.breed = "Golden Retriever";
this.age = 8;
}
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) ;