Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the objects supported by javascript

Shulou Source: shulou.com Published: 2022-06-03 17:31:39 10月03日 Update

This article mainly talks about "what are the objects supported by javascript". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the objects supported by javascript"?

The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.

The JavaScript object is a collection of related properties and methods. Three kinds of objects are supported in JavaScript: built-in objects (native objects), browser objects, and custom objects.

1. JavaScript built-in object:

It refers to the predefined objects in the JavaScript language, which are defined in the ECMAScript standard and are implemented by all browser manufacturers. Because of the unity of the standard, the browser compatibility of these objects is not too big.

String 、 Number 、 Boolean 、 Array 、 Date 、 RegExp 、 Math 、 Error 、 Object 、 Function 、 Global

2. JavaScript Window-browser object:

The browser object model (Browser Object Model (BOM)) allows JavaScript to talk to the browser.

There is no official standard for the browser object Model (BOM). Modern browsers have (almost) implemented the same methods and properties of JavaScript interaction, so it is often mentioned as methods and properties of BOM.

Because modern browsers have (almost) implemented the same methods and properties of JavaScript interactivity, they are often considered to be BOM methods and properties.

Window object:

All browsers support window objects. It represents the browser window.

1), the window object is the top object

2). The window object has six attributes, including document, frames, history, location, navigator and screen, which are also objects themselves.

3) the document attribute under the window object is also an object, and five attributes (anchors, forms, images, links, location) under the document are also objects.

3. JavaScript custom object:

With JavaScript, you can define and create your own objects.

There are two different ways to create a new object:

Define and create an instance of an object

Use functions to define objects, and then create new object instances

Create a custom object:

Var person=new Object (); person.firstname= "John"; person.lastname= "Doe"; person.age=50;person.eyecolor= "blue"; [xss_clean] (person.firstname + "is" + person.age + "years old."). At this point, I believe you have a deeper understanding of "which objects are supported by javascript." Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Objects browsers browsing properties methods support standards same content examples models learning different practical deeper interactivity interest compatibility functions manufacturers Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Tech Info OPPO Reno Redmi NVidia