why javascript is object oriented code example
Example 1: oop js is
function Person(name) {
this.name = name;
this.greeting = function() {
alert('Hi! I\'m ' + this.name + '.');
};
}
Example 2: oops in javascript
const book = { title: "Hippie", author: "Paulo Coelho", year: "2018"}
Example 3: is javascript object oriented
var js = new JavaScript();
js.isObjectOrientated = true;