I created two Objects. The first one is working as intended.
let working = {constructor: function(){
console.log("working");
}};
let notworking = {constructor(){
console.log("notworking");
}}
new working.constructor();
new notworking.constructor();
But the second one throws an Error. The Error message is:
Uncaught TypeError: notworking.constructor is not a constructor
Tested on Firefox and Chrome.
In Firefox DevTools the Object itself looks the same. There is a difference in the constructor method. The working constructor has properties arguments, caller, length and name. The notworking constructor has only the properties length and name.
So what is the difference between these two objects or constructors?