js的API不算太多,不熟悉的分別百度之。講究的是全局觀,沒(méi)事時(shí)候就過(guò)過(guò),熟記于心。
1.全局對(duì)象
值屬性:
NaN
Infinity
undefined
函數(shù)屬性:
eval
parseInt
parseFloat
isNaN
isFinite
處理URI的函數(shù)屬性:
decodeURI
decodeURIComponent
encodeURI
encodeURIComponent
構(gòu)造器屬性
Object
Function
Array
String
Boolean
Number
Date
RegExp
Error
EvalError
RangeError
ReferenceError
SyntaxError
TypeError
URIError
全局對(duì)象的其他屬性:
Math
JSON
2.Object對(duì)象
構(gòu)造器的屬性:
Object.prototype
Object.getPrototypeOf()
Object.getOwnPropertyDescriptor()
Object.getOwnPropertyNames()
Object.create()
Object.defineProperty()
Object.defineProperties()
Object.seal()
Object.freeze()
Object.preventExtensions()
Object.isSealed()
Object.isFrozen()
Object.isExtensible()
Object.keys()
原型對(duì)象的屬性:
Object.prototype.constructor
Object.prototype.toString()
Object.prototype.toLocaleString()
Object.prototype.valueOf()
Object.prototype.hasOwnProperty()
Object.prototype.isPrototypeOf()
Object.prototype.propertyIsEnumerable()
3.Function對(duì)象
構(gòu)造器的屬性:
Function.prototype
Function.length
原型對(duì)象的屬性:
Function.prototype.constructor
Function.prototype.toString()
Function.prototype.apply()
Function.prototype.call()
Function.prototype.bind()
實(shí)例的屬性:
length
prototype
4.Array對(duì)象
構(gòu)造器的屬性:
Array.prototype
Array.isArray
原型對(duì)象的屬性:
Array.prototype.constructor
Array.prototype.toString()
Array.prototype.toLocaleString()
Array.prototype.concat()
Array.prototype.join()
Array.prototype.pop()
Array.prototype.push()
Array.prototype.reverse()
Array.prototype.shift()
Array.prototype.slice()
Array.prototype.sort()
Array.prototype.splice()
Array.prototype.unshift()
Array.prototype.indexOf()
Array.prototype.lastIndexOf()
Array.prototype.every()
Array.prototype.some()
Array.prototype.forEach()
Array.prototype.map()
Array.prototype.filter()
Array.prototype.reduce()
Array.prototype.reduceRight()
實(shí)例屬性:
length
5.String對(duì)象
構(gòu)造器屬性:
String.prototype
String.fromCharCode()
prototype屬性:
String.prototype.constructor
String.prototype.toString()
String.prototype.valueOf()
String.prototype.charAt()
String.prototype.charCodeAt()
String.prototype.concat()
String.prototype.indexOf()
String.prototype.lastIndexOf()
String.prototype.localeCompare()
String.prototype.match()
String.prototype.replace()
String.prototype.search()
String.prototype.slice()
String.prototype.split()
String.prototype.substring()
String.prototype.toLowerCase()
String.prototype.toLocaleLowerCase()
String.prototype.toUpperCase()
String.prototype.toLocaleUpperCase()
String.prototype.trim()
實(shí)例屬性:
length
6.Boolean對(duì)象
構(gòu)造器的屬性:
prototype
原型對(duì)象的屬性:
Boolean.prototype.constructor
Boolean.prototype.toString()
Boolean.prototype.valueOf()
6.Number對(duì)象
構(gòu)造器的屬性:
prototype
MAX_VALUE
MIN_VALUE
NaN
NEGATIVE_INFINITY
POSITIVE_INFINITY
原型對(duì)象的屬性:
Number.prototype.constructor
Number.prototype.toString()
Number.prototype.toLocaleString()
Number.prototype.valueOf()
Number.prototype.toFixed()
Number.prototype.toExponential()
Number.prototype.toPrecision()
7.Math對(duì)象
值屬性:
E
LN10
LN2
LOG2E
LOG10E
PI
SQRT1_2
SQRT2
函數(shù)屬性:
abs()
acos()
asin()
atan()
atan2()
ceil()
cos()
exp()
floor()
log()
max()
min()
pow()
random()
round()
sin()
sqrt()
tan()
8.Date對(duì)象
構(gòu)造器屬性:
Date.prototype
Date.parse()
Date.UTC()
Date.now()
原型對(duì)象的屬性:
Date.prototype.constructor
Date.prototype.toString()
Date.prototype.toDateString()
Date.prototype.toTimeString()
Date.prototype.toLocaleString()
Date.prototype.toLocaleDateString()
Date.prototype.toLocaleTimeString()
Date.prototype.valueOf()
Date.prototype.getTime()
Date.prototype.getFullYear()
Date.prototype.getUTCFullYear()
Date.prototype.getMonth()
Date.prototype.getUTCMonth()
Date.prototype.getDate()
Date.prototype.getUTCDate()
Date.prototype.getDay()
Date.prototype.getUTCDay()
Date.prototype.getHours()
Date.prototype.getUTCHours()
Date.prototype.getMinutes()
Date.prototype.getUTCMinutes()
Date.prototype.getSeconds()
Date.prototype.getUTCSeconds()
Date.prototype.getMilliseconds()
Date.prototype.getUTCMilliseconds()
Date.prototype.getTimezoneOffset()
Date.prototype.setTime()
Date.prototype.setFullYear()
Date.prototype.setUTCFullYear()
Date.prototype.setMonth()
Date.prototype.setUTCMonth()
Date.prototype.setDate()
Date.prototype.setUTCDate()
Date.prototype.setHours()
Date.prototype.setUTCHours()
Date.prototype.setMinutes()
Date.prototype.setUTCMinutes()
Date.prototype.setSeconds()
Date.prototype.setUTCSeconds()
Date.prototype.setMilliseconds()
Date.prototype.setUTCMilliseconds()
Date.prototype.toUTCString()
Date.prototype.toISOString()
Date.prototype.toJSON()
9.RegExp對(duì)象
構(gòu)造器的屬性:
RegExp.prototype
原型對(duì)象的屬性:
RegExp.prototype.exec()
RegExp.prototype.test()
RegExp.prototype.toString()
實(shí)例屬性:
source
global
ignoreCase
multiline
lastIndex
10.Erorr對(duì)象
構(gòu)造器屬性:
Error.prototype
原型對(duì)象的屬性:
Error.prototype.constructor
Error.prototype.name
Error.prototype.message
Error.prototype.toString()
11.JSON對(duì)象
parse()
stringify()