What is an object?

What is an object?

All data in JavaScript can be viewed as objects, and each object has itsproperties and methods.

The properties of an object reflect certain specific properties of the object, such as: the length of the string, the length and width of the image, the text in the text box (Textbox), etc.;

The method of an object can do something to the object, for example,"Submit" of the form, "Scrolling" of the window, etc.

For example, when applying for a variable:

var my_var="m.sbmmt.com";

In fact, a string object is created. This object has The built-in attribute my_var.length = 10

At the same time, this string object also has several built-in methods, such as the my_var.toUpperCase() method that can convert characters to uppercase; the my_var.charAt(n) method Can return the nth character.

Continuing Learning
||
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!