best way to object oriented javascript code example
Example 1: js oop
var salva = createNewPerson('Salva');
salva.name;
salva.greeting();
Example 2: js oop
let names = {
fname: "Dillion",
lname: "Megida"
}
console.log(names.fname);
console.log(names.hasOwnProperty("mname"));
// Expected Output
// Dillion
// false