Answers for "how to create object in javascript with class"

3

how to create object in javascript with class

class Car {

   constructor(name, year) {

    this.name = name;

    this.year = year;

  }

}
Posted by: Guest on March-08-2021
2

how to create object in javascript with class

let myCar1 = new Car("Ford", 2014);

let myCar2 = new Car("Audi", 2019);
Posted by: Guest on March-08-2021
10

objects in javascript

let object = {
  'key1': 'value1',
  'key2': 'value2',
  'keyn': 'valuen',
};
console.log(object);
Posted by: Guest on June-19-2020
0

objects in javascript

let name = {
	name1: 'mark'
}
Posted by: Guest on July-03-2020
0

objects in javascript

var object = {'key':'value','the value can be anything',[1,null,'Dr.Hippo']};
Posted by: Guest on February-21-2020

Code answers related to "how to create object in javascript with class"

Code answers related to "Javascript"

Browse Popular Code Answers by Language