Home > Web Front-end > JS Tutorial > body text

What should novices know about learning js?

零下一度
Release: 2017-06-27 10:25:12
Original
940 people have browsed it

Javascript data types (symbol)
1. 6 primitive data types or basic data types

1, undefined (1, the statement is not assigned, 2, the function has no return value)
2,null (empty, does not exist)
3,number (numbers, decimals and integers)
4,boolean (Boolean value, true, false)
5,string (string, single quote or double (Quotation means)
6, es6 symbol original data type uses Symbol() to generate a unique value, you can pass the parameter Symbol('dd'), string class, does not affect its value; use ## as an attribute value #This was an error in the initial implementation of JavaScript and was later used by ECMAScript. Today we can explain that null is a placeholder for a non-existent object, but we still need to pay attention to this feature when actually coding.
ECMAScript believes that undefined is derived from null, so they are defined as equal. of. However, what should we do if in some cases we must distinguish between these two values? The following two methods can be used.

2. Reference data type or complex data type

1, object The object object is an unordered property set. The "property" here can be a basic value, object or function
2, Array array
3, function function
5, object is the parent of all reference types

The difference between original data types and reference data types:

Primitive data types

1. Simple data segment
2. Stored value (stack)

Reference data type
1. Object composed of multiple values
2. Stored address (heap)

The above is the detailed content of What should novices know about learning js?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template