how to make oop code in 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