前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >JS常用方法

JS常用方法

作者头像
河马嘴不大
发布2022-12-24 12:18:15
3.2K0
发布2022-12-24 12:18:15
举报
数组方法:在Array.prototype中定义

ECMAScript3: 12个

  1. join
  2. reverse
  3. sort
  4. concat
  5. slice
  6. splice
  7. push\pop
  8. unshift\shift
  9. toString\toLocaleString 区别在于new Date( ) “Thu Dec 14 2017 11:35:15 GMT+0800 (CST)” / “2017/12/14 上午11:35:15”

ECMAScript5: 10个

  1. forEach
  2. map
  3. filter
  4. every\some
  5. reduce\reduceRight
  6. indexOf\lastIndexOf
  7. Array.isArray( )8

ECMAScript6: 6个

  1. Array.from
  2. Array.of
  3. copyWithin
  4. find
  5. findIndex
  6. fill

ECMAScript7: 1个

  1. includes
字符串方法:在String.prototype中定义

ECMAScript3: 8个

  1. split
  2. slice
  3. substring
  4. substr
  5. concat
  6. indexOf
  7. lastIndexOf
  8. charAt

ECMAScript5: 1个

  1. trim

ECMAScript6: 8个

  1. includes
  2. startsWith
  3. endsWith
  4. at
  5. repeat
  6. padStart\padEnd
  7. 字符串模板
对象方法:在Object.prototype中定义

ECMAScript3:

ECMAScript5:

  1. Object.isFrozen
  2. Object.freeze
  3. Object.seal
  4. Object.isSealed
  5. Object.isExtensible
  6. Object.preventExtensions
  7. Object.getOwnPropertyNames
  8. Object.getOwnPropertyDescriptor
  9. Object.defineProperties
  10. Object.defineProperty
  11. Object.create

ECMAScript6:

  1. Object.is
  2. Object.assign
  3. Object.setPrototypeOf()
  4. Object.getPrototypeOf()
迭代的方法:
  1. Object.keys
  2. Object.values
  3. Object.entries
  4. for….of
  5. for….in
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018-01-30,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 数组方法:在Array.prototype中定义
  • 字符串方法:在String.prototype中定义
  • 对象方法:在Object.prototype中定义
  • 迭代的方法:
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档