var mobile = {};
mobile['model'] = 'Samsung Galaxy';
var mobile = {
name: 'Samung',
model: 'Galaxy'
};
var Mobile = new Object();
function mobile () {
return {
model : 'Galaxy';
}
}
var samsung = mobile();
function Mobile () {
this.model = 'Galaxy',
this.price = 12000,
}
var samsung = new Mobile();
console.log(samsung.model);
//Function expression
var Mobile = function() { //We consider "Mobile" as a class
this.model = 'Galaxy',
this.price = 12000,
}
var samsung = new Mobile();
console.log(samsung.model);