ES6对象赋值: // es5 let name = "ananiah"; let skill ='web'; let obj = {name:name,skill:skill}; console.log(obj) // es6 用变量形式赋值 let name = "ananiah"; let skill ='web'; let obj = {name,skill}; console.log(obj) key值构建 // es6-key值的构建 let key =
源码: function isObj(x){ var type = typeof x; return x !== null && (type === 'object' || type === 'function'); } var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(va