[JavaScript] a summary of the basics of JavaScript some knowledge points

JavaScript basic data types in

 

 Data Type Name  Data Type Description
Undefined Only one value, that is  undefined , the initial value of the variable declaration.
Null Only one value, i.e.  null , indicates a null pointer value is derived  value. undefined null 
String 16 consists of zero or more  Unicode characters
Boolean Only two values,  true and false
Number The type used  IEEE754 to represent integer and floating point.
Object It is actually a collection of data and functionality in a set of ECMAScript objects.
Symbol ES6 new data type is added, it represents a unique value.

Wherein the  Object type comprising  Function , , , . Array  Date  RegExp 

JavaScript built-in objects

Object Name Object Description
Arguments Function parameter set
Array Array
Boolean Boolean object
Date Date Object
Error Exception object
Function Function constructor
Math Mathematical objects
Number Numeric objects
Object The base object
String String object

typeof null Return result 'object'

  From the logical point of view, value represents a null object pointer, and therefore a return  , is a JavaScript can be understood as an early BUG, and this is now the standard specification. V8 had been corrected and to achieve , but in the end prove feasible. null 'object typeof null === 'null' 

Array And the role of object methods

Method name Object Description
concat For connecting two or more array and returns the result, arr1.concat(arr2)
join All the elements of the array into a string, the development of elements separated by delimiters arr1.join(',')
pop Removes and returns the last element in the array arr1.pop()
push Add one or more elements to the end of the array, and returns the new length arr1.push(1)
reverse Reverse the order of elements in the array, arr1.reverse()
shift Removes and returns the first element in the array arr1.shift()
slice Returns the specified element from an existing array
sort Of the elements of the array to sort arr1.sort()
splice Remove elements and add new elements in the array
The array translated into strings arr1.toString()
Local string array to convert arr1.toLocaleString()
unshift Add one or more elements to the beginning of an array arr1.unshift(1)
Returns an array of object's original value

typeof The possible return values

Types of Back to Results
Undefined "undefined"
Null "object"
Boolean "boolean"
Number "number"
String "string"
Symbol (ECMAScript 6 new) "symbol"
Host object (provided by the environment JS) Implementation-dependent
Function object ([[Call]] implemented in terms of the ECMA-262) "function"
Any other objects "object"

Article incorrect place, please give correct.

Guess you like

Origin www.cnblogs.com/zmlljx/p/12212703.html