es5新特性

严格模式

// 在JS文件或者函数的顶部添加'use strict' 启用严格模式
'use strict';
function do () {
  console.log(111)
}

function test () {
  'use strict';
  console.log(111)
}

JSON

// parse:反序列化成json对象
let str = '{"width": 34, "height": 23}'
let jsonObj = JSON.parse(str)

// stringify:序列化成json字符串
let testObj = {width: 34, height: 23}
let jsonStr = JSON.stringify(testObj)

Array

Object

Function Extend

参考

Last updated

Was this helpful?