0
如何創建一個Map,需要new
並且它不是必需的對象?Map vs Object的和諧ES6構造函數類型?
var o = new Object();
var m = new Map();
var constructorObject = o.constructor;
var constructorMap = m.constructor;
var newObject = constructorObject();
var newMap = constructorMap(); //splat
最後一行產生,
TypeError: Constructor Map requires 'new'
at Map (native)