In this chapter, we are going to learn about object-oriented programming (OOP) and discuss the code of the famous game, Hangman.
"OOP is a programming paradigm that uses abstraction to create models based on the real world. OOP uses several techniques from previously established paradigms, including modularity, polymorphism, and encapsulation." or "OOP languages typically are identified through their use of classes to create multiple objects that have the same properties and methods."
You probably have assumed that JavaScript is an object-oriented programming language. Yes, you are absolutely correct. Let's see why it is an OOP language. If a computer programming language has the following few features, we call it object oriented:
Inheritance
Polymorphism
Encapsulation
Abstraction
Before going any further, let's discuss objects. We create objects in JavaScript in the following manner:
var person = new Object(); person.name = "Harry Potter"; person.age =...