Javascript API总结

97 阅读1分钟

Object 属性与方法

Object 原型属性与方法

Object.prototype.constructor
Object.prototype.__proto__

Object.prototype.hasOwnProperty()
Object.prototype.isPrototypeOf()
Object.prototype.propertyIsEnumerable()
Object.prototype.toLocaleString()
Object.prototype.toString()
Object.prototype.valueOf()

Object 静态方法

Object.assign()
Object.create()

Object.defineProperties(target)
Object.defineProperty(target, key)

Object.getOwnPropertyDescriptor(target, key)
Object.getOwnPropertyDescriptors(target)

Object.getOwnPropertyNames()
Object.getOwnPropertySymbols()

Object.setPrototypeOf(target1, target2)
Object.getPrototypeOf(target)

Object.hasOwn()
Object.is()

Object.isExtensible()
Object.isSealed()
Object.isFrozen()

Object.preventExtensions()
Object.seal()
Object.freeze()

Object.fromEntries()
Object.entries()
Object.keys()
Object.values()

Function 属性与方法

Function.prototype.length
Function.prototype.name
Function.prototype.prototype

Function.prototype.apply()
Function.prototype.bind()
Function.prototype.call()
Function.prototype.toString()

Object(可继承)

Object.prototype.constructor
Object.prototype.__proto__

Object.prototype.hasOwnProperty()
Object.prototype.isPrototypeOf()
Object.prototype.propertyIsEnumerable()
Object.prototype.toLocaleString()
Object.prototype.toString()
Object.prototype.valueOf()

Function(可继承)

Function.prototype.length
Function.prototype.name
Function.prototype.prototype

Function.prototype.apply()
Function.prototype.bind()
Function.prototype.call()
Function.prototype.toString()

Array(继承Function、Object)

Array 属性

Array.prototype[@@unscopables]
Array.prototype.length

Array 方法

Array.prototype[@@iterator]()
get Array[@@species]

Array.from()
Array.isArray()
Array.of()

Array.prototype.includes()

Array.prototype.pop()
Array.prototype.push()
Array.prototype.shift()
Array.prototype.unshift()

Array.prototype.at()
Array.prototype.concat()
Array.prototype.copyWithin()
Array.prototype.fill()
Array.prototype.join()

Array.prototype.reverse()
Array.prototype.sort()

Array.prototype.slice()
Array.prototype.splice()

Array.prototype.flat()
Array.prototype.flatMap()

Array.prototype.entries()
Array.prototype.keys()
Array.prototype.values()

Array.prototype.filter()
Array.prototype.every()
Array.prototype.some()
Array.prototype.forEach()
Array.prototype.map()

Array.prototype.indexOf()
Array.prototype.lastIndexOf()

Array.prototype.find()
Array.prototype.findIndex()
Array.prototype.findLast()
Array.prototype.findLastIndex()

Array.prototype.group()
Array.prototype.groupToMap()

Array.prototype.reduce()
Array.prototype.reduceRight()

Array.prototype.toLocaleString()
Array.prototype.toString()

Number(继承Function、Object)

Number 属性

Number.EPSILON
Number.MAX_SAFE_INTEGER
Number.MAX_VALUE
Number.MIN_SAFE_INTEGER
Number.MIN_VALUE
Number.NaN
Number.NEGATIVE_INFINITY
Number.POSITIVE_INFINITY

Number 方法

Number.isFinite()
Number.isInteger()
Number.isNaN()
Number.isSafeInteger()
Number.parseFloat()
Number.parseInt()
Number.prototype.toExponential()
Number.prototype.toFixed()
Number.prototype.toLocaleString()
Number.prototype.toPrecision()
Number.prototype.toString()
Number.prototype.valueOf()

String(继承Function、Object)

String 属性

String length

String 方法

String.prototype[@@iterator]()

String.raw()
String.fromCharCode()
String.fromCodePoint()

String.prototype.at()
String.prototype.charAt()
String.prototype.charCodeAt()
String.prototype.codePointAt()

String.prototype.concat()
String.prototype.endsWith()

String.prototype.includes()
String.prototype.indexOf()

String.prototype.lastIndexOf()

String.prototype.localeCompare()
String.prototype.match()
String.prototype.matchAll()
String.prototype.normalize()
String.prototype.padEnd()
String.prototype.padStart()
String.prototype.repeat()
String.prototype.replace()
String.prototype.replaceAll()
String.prototype.search()
String.prototype.slice()
String.prototype.split()
String.prototype.startsWith()
String.prototype.substring()

String.prototype.toLocaleLowerCase()
String.prototype.toLocaleUpperCase()
String.prototype.toLowerCase()
String.prototype.toString()
String.prototype.toUpperCase()
String.prototype.trim()
String.prototype.trimEnd()
String.prototype.trimStart()
String.prototype.valueOf()

Set(继承Function、Object)

Set 属性

get Set[@@species]

Set.prototype.size

Set 方法

Set.prototype[@@iterator]()

Set.prototype.has()

Set.prototype.add()
Set.prototype.delete()
Set.prototype.clear()

Set.prototype.forEach()

Set.prototype.entries()
Set.prototype.keys()
Set.prototype.values()

Map(继承Function、Object)

Map 属性

get Map[@@species]
Map.prototype[@@toStringTag]

Map.prototype.size

Map 方法

Map.prototype[@@iterator]()

Map.prototype.has()

Map.prototype.set()
Map.prototype.get()
Map.prototype.delete()
Map.prototype.clear()

Map.prototype.forEach()

Map.prototype.entries()
Map.prototype.keys()
Map.prototype.values()

Symbol(继承Function、Object)

Symbol属性

Symbol.asyncIterator
Symbol.prototype.description
Symbol.hasInstance
Symbol.isConcatSpreadable
Symbol.iterator
Symbol.match
Symbol.matchAll
Symbol.replace
Symbol.search
Symbol.species
Symbol.split
Symbol.toPrimitive
Symbol.toStringTag
Symbol.unscopables

Symbol方法

Symbol.prototype[@@toPrimitive]

Symbol.for()
Symbol.keyFor()

Symbol.prototype.toString()
Symbol.prototype.valueOf()

Math(继承Object)

Math 属性

Math.E
Math.LN10
Math.LN2
Math.LOG10E
Math.LOG2E
Math.PI
Math.SQRT1_2
Math.SQRT2

Math 方法

Math.abs()
Math.acos()
Math.acosh()
Math.asin()
Math.asinh()
Math.atan()
Math.atan2()
Math.atanh()
Math.cbrt()
Math.ceil()
Math.clz32()
Math.cos()
Math.cosh()
Math.exp()
Math.expm1()
Math.floor()
Math.fround()
Math.hypot()
Math.imul()
Math.log()
Math.log10()
Math.log1p()
Math.log2()
Math.max()
Math.min()
Math.pow()
Math.random()
Math.round()
Math.sign()
Math.sin()
Math.sinh()
Math.sqrt()
Math.tan()
Math.tanh()
Math.trunc()

Date(继承Object)

Date方法

Date.now()
Date.parse()
Date.UTC()

Date.prototype[@@toPrimitive]
Date.prototype.getDate()
Date.prototype.getDay()
Date.prototype.getFullYear()
Date.prototype.getHours()
Date.prototype.getMilliseconds()
Date.prototype.getMinutes()
Date.prototype.getMonth()
Date.prototype.getSeconds()
Date.prototype.getTime()
Date.prototype.getTimezoneOffset()

Date.prototype.getUTCDate()
Date.prototype.getUTCDay()
Date.prototype.getUTCFullYear()
Date.prototype.getUTCHours()
Date.prototype.getUTCMilliseconds()
Date.prototype.getUTCMinutes()
Date.prototype.getUTCMonth()
Date.prototype.getUTCSeconds()

Date.prototype.setDate()
Date.prototype.setFullYear()
Date.prototype.setHours()
Date.prototype.setMilliseconds()
Date.prototype.setMinutes()
Date.prototype.setMonth()
Date.prototype.setSeconds()
Date.prototype.setTime()

Date.prototype.setUTCDate()
Date.prototype.setUTCFullYear()
Date.prototype.setUTCHours()
Date.prototype.setUTCMilliseconds()
Date.prototype.setUTCMinutes()
Date.prototype.setUTCMonth()
Date.prototype.setUTCSeconds()

Date.prototype.toDateString()
Date.prototype.toISOString()
Date.prototype.toJSON()
Date.prototype.toLocaleDateString()
Date.prototype.toLocaleString()
Date.prototype.toLocaleTimeString()
Date.prototype.toString()
Date.prototype.toTimeString()
Date.prototype.toUTCString()

Date.prototype.valueOf()