1JavaScript is a prototype based object oriented language,
2 which means it doesnt have classes rather it define
3 behaviors using constructor function and then reuse
4it using the prototype.
1function Person(name) {
2 this.name = name;
3 this.greeting = function() {
4 alert('Hi! I\'m ' + this.name + '.');
5 };
6}
1Javascript IS AN object oriented language, thus it defines behaviors
2using constructor functions.