how to return an object in javascript

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

console.log(person);
//this will return [object Object]
//use
console.log(JSON.stringify(person));
//insteadfunction func() {
  return {
    name: "Name",
    age: 34
  };
}var mycar = new Car('Eagle', 'Talon TSi', 1993);
function Car(make, model, year) {
  this.make = make;
  this.model = model;
  this.year = year;
}

Source

Also in JavaScript: