SoFunction
Updated on 2025-03-10

JavaScript Learning Journey (1)

Chapter 1 A brief history of JavaScript. There is nothing to remember. It briefly introduces the origin of js, the conflicts between browsers, etc.

Chapter 2 JavaScript Syntax. It is worth noting:

(1) String is placed in single or double quotes. I personally recommend using double quotes. (This is a good programming habit)

For example: var mood="happy";

(2) Character escape (escaping) Use backslash \

For example: var mood='don\'t ask'; alert(mood); output don't ask.

var height="about 5'10\" tall"; alert(height); Output about 5'10" tall.

A single quote is included in a string with single quotes. You need to prefix the single quotes in a string with a backslash \

Similarly, double quotes are included in strings with double quotes. You need to prefix the double quotes in the string with backslash \

(3) Function This is important, I won’t talk about it here.

(4) Object Since it is programming, it is no longer called programming without this.



Objects are self-contained data collections, and data can be accessed through two forms--property and method:

Attributes are simply variables

Method simply means function

They all belong to specific objects. They need to use the "dot" syntax to access:



()



(5) Built-in objects. Array objects, Math objects, Date objects, etc. are built-in objects for javascript. They provide many useful methods for us to use. Built-in objects can help you complete many tasks quickly and easily outside.

(6) Host object. Host exclusive mainly includes Form, Image and Element. We can obtain information about form images and various form elements on a given web page through these objects.

Form , Image and Element. It is rarely used because there is an object that can be used to obtain information about any element on a given webpage, which is the well-known document object.