在文件对象上使用ES6扩展运算符

时间:2018-03-05 04:55:44

标签: javascript ecmascript-6 spread-syntax

示例:

console.log(file)
// File object with properties

const f = {...file}
console.log(f)
// empty Object

file.id = 'abcdef'
const ff = {...file}
console.log(ff)
// Object with only property {id: 'abcdef'}

任何人都可以向我解释或发送参考链接

0 个答案:

没有答案
相关问题