Answers for "how to return an object in javascript"

6

object object javascript

person = {
    'name':'john smith'
    'age':41
};

console.log(person);
//this will return [object Object]
//use
console.log(JSON.stringify(person));
//instead
Posted by: Guest on April-20-2020
1

how to return an object in javascript

function func() {
  return {
    name: "Name",
    age: 34
  };
}
Posted by: Guest on May-20-2020
3

js create object with properties

var mycar = new Car('Eagle', 'Talon TSi', 1993);
Posted by: Guest on April-01-2020
2

js create object with properties

function Car(make, model, year) {
  this.make = make;
  this.model = model;
  this.year = year;
}
Posted by: Guest on April-01-2020

Code answers related to "how to return an object in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language