ukemi
0
Q:

js create new object

let obj = {
// fields
  name:"value",
  num: 123,
//methods
  foo: function(){}
  
}
9
function person(fname, lname, age, eyecolor){
  this.firstname = fname;
  this.lastname = lname;
  this.age = age;
  this.eyecolor = eyecolor;
}

myFather = new person("John", "Doe", 50, "blue");
document.write(myFather.firstname + " is " + myFather.age + " years old.");
2
const object = {
  something: "something";
}
2
var about = {
  name:"lanitoman",
  age:1023,
  isHeProgrammer:true
}
0
var a = {
name: "aakash",
  age:30
}
0
let bike = {   name: 'SuperSport',    maker:'Ducati',    start: function() {       console.log('Starting the engine...');   }};bike.start();   //Output: Starting the engine.../* Adding method stop() later to the object */bike.stop = function() {    console.log('Applying Brake...');  }bike.stop();    //Output: Applying Brake...
1
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) ;
0
const person = {
  name: 'Anthony',
  age: 32,
  city: 'Los Angeles',
  occupation: 'Software Developer',
  skills: ['React','JavaScript','HTML','CSS']
};

//Use Template Literal to also log a message to the console
const message = `Hi, I'm ${person.name}. I live in ${person.city}.`;
console.log(message);
-1

New to Communities?

Join the community