Javascript is object-orientedProgramming Language(OOP ).
The OOP language enables us to customize object and variable types.
Object-Oriented Programming
Javascript is an object-oriented programming language (OOP ). The OOP language enables us to define our own objects and variable types.
Don't worry. We will explain how to create your own objects in the advanced JavaScript section. Now, we need to learn about built-in JavaScript objects and how to use them. Starting from the next section, we will explain these built-in JavaScript objects in sequence.
Note:: The object is only a special type of data. The object has attributes and methods.
Attribute
Attribute refers to the value related to the object.
In the following example, we use the Length attribute of the string object to calculate the number of characters in the string.
<SCRIPT type = "text/JavaScript"> var TXT = "Hello world! "Document. Write (txt.Length) </SCRIPT>
The aboveCodeOutput:
12
Method
A method is a behavior that can be executed by an object (or a function that can be completed ).
In the following example, we use the touppercase () method of the string object to display uppercase letters and texts.
<SCRIPT type = "text/JavaScript"> var STR = "Hello world! "Document. Write (Str.Touppercase ()) </SCRIPT>
The above code output is:
Hello world!