用JS创建空白对象

时间:2018-11-20 00:19:18

标签: javascript node.js

很好奇是否有人知道两者之间是否有区别

const dict = Object.setPrototypeOf({}, null);

const dict = Object.create(null);

请参阅:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf

0 个答案:

没有答案