JavaScript的API背誦篇

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()

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • js API1.全局對(duì)象NAN 非數(shù)字值的特殊值infinity 代表正無(wú)窮的數(shù)據(jù)undefined 2.函數(shù)屬性...
    Aa劉德健閱讀 1,709評(píng)論 0 2
  • 第3章 基本概念 3.1 語(yǔ)法 3.2 關(guān)鍵字和保留字 3.3 變量 3.4 數(shù)據(jù)類型 5種簡(jiǎn)單數(shù)據(jù)類型:Unde...
    RickCole閱讀 5,529評(píng)論 0 21
  • 1.通過(guò)typeof可以判斷處幾種基本數(shù)據(jù)類型Boolean,number,string,null,undefin...
    舟漁行舟閱讀 691評(píng)論 0 1
  • JavaScript語(yǔ)言精粹 前言 約定:=> 表示參考相關(guān)文章或書籍; JS是JavaScript的縮寫。 本書...
    微笑的AK47閱讀 659評(píng)論 0 3
  • 【0123我在悅讀】@龍九 書名:《多說(shuō)與少說(shuō)》 作者:葉圣陶 篇目:#精讀的指導(dǎo)#、#略讀的指導(dǎo)# 收獲: ①精...
    丨九歌丨閱讀 306評(píng)論 0 0

友情鏈接更多精彩內(nèi)容