zoukankan      html  css  js  c++  java
  • 《深入理解JavaScript》—— ECMAScript5 新特性

    (1) 标准库的新功能

    1. 元编程

    ① 获取和设置原型

    —— Object.create()

    —— Object.getPrototypeOf()

    ② 通过属性描述符管理属性特性

    —— Object.defineProperty()

    —— Object.defineProperties()

    —— Object.create()

    —— Object.getOwnPropertyDescriptor()

    ③ 列出属性

    —— Object.keys()

    —— Object.getOwnPropertyNames()

    ④ 保护对象

    —— Object.preventExtensions()

    —— Object.isExtensible()

    —— Object.seal()

    —— Object.isSealed()

    —— Object.freeze()

    —— Object.isFrozen()

    (2) 新方法

    ① 新方法 String.prototype.trim()

    ② 通过方括号访问字符

    ③ 新数组方法

    —— Array.isArray()

    —— Array.prototype.every()

    —— Array.prototype.some()

    —— Array.prototype.filter()

    —— Array.prototype.forEach()

    —— Array.prototype.indexOf()

    —— Array.prototype.lastIndexOf()

    —— Array.prototype.map()

    —— Array.prototype.reduce()

    ④ 新Date方法

    —— Date.now()

    —— Date.prototype.toISOString()

    (3) JSON

    支持JSON。

    —— JOSN.parse()

    —— JOSN.stringify()

    —— 一些内建对象具有特殊的toJSON方法:

    Boolean.prototype.toJSON()

    Number.prototype.toJSON()

    String.prototype.toJSON()

    Date.prototype.toJSON()

  • 相关阅读:
    使用js固定div的高度
    iphone开发常用编码
    php mssql扩展SQL查询中文字段名解决方法
    Android带进度条文件上传
    PHP中替换换行符
    Android Timer计时器
    语法:MySQL中INSERT INTO SELECT的使用
    mysql的多表关联更新怎么写?
    Page Utility
    How do use CheckBoxList Utility
  • 原文地址:https://www.cnblogs.com/luohaoran/p/5988063.html
Copyright © 2011-2022 走看看