Answers for "make an object javascript"

10

objects in javascript

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

creating an object javascript

let obj = {
// fields
  name:"value",
  num: 123,
//methods
  foo: function(){}
  
}
Posted by: Guest on January-06-2020
2

objects in javascript

let car = {
  engineNumber: 1234
  brand: 'BMW',
  break: function (){}
}
Posted by: Guest on December-03-2020
1

how to make an object in javascript

let myDog = {		
  legs: value			

}
  console.log(myDog);
/*Doesn't have to be a Dog it can be anyting you want*/
Posted by: Guest on June-29-2021
1

make an object javascript

class ObjectLayout {
	constructor() {
    	this.firstName = "Larry"; //property
    }
  
  	sayHi() { // Method
    	return `Hello from ${this.firstName}`;
    }
}

const object = new ObjectLayout();
// object.firstName is Larry;
// object.sayHi() gives "Hello from Larry"
Posted by: Guest on November-03-2020
3

objects javascript

function Dog() {
  this.name = "Bailey"; 
  this.colour = "Golden"; 
  this.breed = "Golden Retriever";
  this.age = 8;
}
Posted by: Guest on January-05-2021

Code answers related to "make an object javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language