function Car(name, model, price) {
this.n = name;
this.m = model;
this.p = price;
}
// Needed Output
"Car One Name Is MG And Model Is 2022 And Price Is 420000"
"Car Is Running Now"
function createNewPerson(name) {
var obj = {};
obj.name = name;
obj.greeting = function() {
alert('Hi! I'm ' + this.name + '.');
};
return obj;
}
let names = {
fname: "Dillion",
lname: "Megida"
}
console.log(names.fname);
console.log(names.hasOwnProperty("mname"));
// Expected Output
// Dillion
// false
function Car(name, model, price) {
this.n = name;
this.m = model;
this.p = price;
}
// Needed Output
"Car One Name Is MG And Model Is 2022 And Price Is 420000"
"Car Is Running Now"
var salva = createNewPerson('Salva');
salva.name;
salva.greeting();