了解JavaScript核心

Object


Object
 .assign(target, ...src)                -> target
 .is(a, b)                              -> bool
 .setPrototypeOf(target, proto | null)  -> target (required __proto__ - IE11+)
 .create(object | null, descriptors?)   -> object
 .getPrototypeOf(var)                   -> object | null
 .defineProperty(object, key, desc)     -> target
 .defineProperties(object, descriptors) -> target
 .getOwnPropertyDescriptor(var, key)    -> desc | undefined
 .keys(var)                             -> array
 .getOwnPropertyNames(var)              -> array
 .freeze(var)                           -> var
 .seal(var)                             -> var
 .preventExtensions(var)                -> var
 .isFrozen(var)                         -> bool
 .isSealed(var)                         -> bool
 .isExtensible(var)                     -> bool
 #toString()                            -> string, ES6 fix: @@toStringTag support


Function


Function
 #bind(object, ...args) -> boundFn(...args)
 #name                  -> string (IE9+)
 #@@hasInstance(var)    -> bool

Array


Array
 .from(iterable | array-like, mapFn(val, index)?, that) -> array
 .of(...args)                                           -> array
 .isArray(var)                                          -> bool
 #copyWithin(target = 0, start = 0, end = @length)      -> @
 #fill(val, start = 0, end = @length)                   -> @
 #find(fn(val, index, @), that)                         -> val
 #findIndex(fn(val, index, @), that)                    -> index | -1
 #values()                                              -> iterator
 #keys()                                                -> iterator
 #entries()                                             -> iterator
 #join(string = ',')                                    -> string, fix for ie7-
 #slice(start?, end?)                                   -> array, fix for ie7-
 #indexOf(var, from?)                                   -> index | -1
 #lastIndexOf(var, from?)                               -> index | -1
 #every(fn(val, index, @), that)                        -> bool
 #some(fn(val, index, @), that)                         -> bool
 #forEach(fn(val, index, @), that)                      -> void
 #map(fn(val, index, @), that)                          -> array
 #filter(fn(val, index, @), that)                       -> array
 #reduce(fn(memo, val, index, @), memo?)                -> var
 #reduceRight(fn(memo, val, index, @), memo?)           -> var
 #sort(fn?)                                             -> @, invalid arguments fix
 #@@iterator()                                          -> iterator (values)
 #@@unscopables                                         -> object (cap)
Arguments
 #@@iterator() -> iterator (values, available only in core-js methods)


String


String
 .fromCodePoint(...codePoints) -> str
 .raw({raw}, ...substitutions) -> str
 #includes(str, from?) -> bool
 #startsWith(str, from?) -> bool
 #endsWith(str, from?) -> bool
 #repeat(num) -> str
 #codePointAt(pos) -> uint
 #trim() -> str, ES6 fix
 #anchor(name)     -> str
 #big()            -> str
 #blink()          -> str
 #bold()           -> str
 #fixed()          -> str
 #fontcolor(color) -> str
 #fontsize(size)   -> str
 #italics()        -> str
 #link(url)        -> str
 #small()          -> str
 #strike()         -> str
 #sub()            -> str
 #sup()            -> str
 #@@iterator() -> iterator (code points)


RegExp


[new] RegExp(pattern, flags?) -> regexp, ES6 fix: can alter flags (IE9+)
 #flags -> str (IE9+)
 #toString() -> str, ES6 fixes
 #@@match(str)             -> array | null
 #@@replace(str, replacer) -> string
 #@@search(str)            -> index
 #@@split(str, limit)      -> array
String
 #match(tpl)             -> var, ES6 fix for support @@match
 #replace(tpl, replacer) -> var, ES6 fix for support @@replace
 #search(tpl)            -> var, ES6 fix for support @@search
 #split(tpl, limit)      -> var, ES6 fix for support @@split, some fixes for old engines


Number


[new] Number(var)         -> number | number object
 .isFinite(num)          -> bool
 .isNaN(num)             -> bool
 .isInteger(num)         -> bool
 .isSafeInteger(num)     -> bool
 .parseFloat(str)        -> num
 .parseInt(str)          -> int
 .EPSILON                -> num
 .MAX_SAFE_INTEGER       -> int
 .MIN_SAFE_INTEGER       -> int
 #toFixed(digits)        -> string, fixes
 #toPrecision(precision) -> string, fixesparseFloat(str)           -> num, fixesparseInt(str)             -> int, fixes


Math


Math
 .acosh(num)     -> num
 .asinh(num)     -> num
 .atanh(num)     -> num
 .cbrt(num)      -> num
 .clz32(num)     -> uint
 .cosh(num)      -> num
 .expm1(num)     -> num
 .fround(num)    -> num
 .hypot(...args) -> num
 .imul(num, num) -> int
 .log1p(num)     -> num
 .log10(num)     -> num
 .log2(num)      -> num
 .sign(num)      -> 1 | -1 | 0 | -0 | NaN
 .sinh(num)      -> num
 .tanh(num)      -> num
 .trunc(num)     -> num

Date


Date
 .now()               -> int
 #toISOString()       -> string
 #toJSON()            -> string
 #toString()          -> string
 #@@toPrimitive(hint) -> primitive


Promise


new Promise(executor(resolve(var), reject(var))) -> promise
 #then(resolved(var), rejected(var))            -> promise
 #catch(rejected(var))                          -> promise
 .resolve(promise | var)                        -> promise
 .reject(var)                                   -> promise
 .all(iterable)                                 -> promise
 .race(iterable)                                -> promise


Symbol


Symbol(description?)  -> symbol
 .hasInstance        -> @@hasInstance
 .isConcatSpreadable -> @@isConcatSpreadable
 .iterator           -> @@iterator
 .match              -> @@match
 .replace            -> @@replace
 .search             -> @@search
 .species            -> @@species
 .split              -> @@split
 .toPrimitive        -> @@toPrimitive
 .toStringTag        -> @@toStringTag
 .unscopables        -> @@unscopables
 .for(key)           -> symbol
 .keyFor(symbol)     -> key
 .useSimple()        -> void
 .useSetter()        -> voidObject
 .getOwnPropertySymbols(object) -> array

▼点击阅读原文


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值