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