Hi guys I am a bit confused about the arrow function i read the arrow function documentation on mozila developers and I found out that the arrow functions cannot be used as constructors and will throw an error when used with new. but in this example I didn't get any errors it returns an empty object however I passed the parameters that I want to construct the object with.
Here is the documentation.
let ConstructObjectArrow = (name, age, city)=>{
this.name = name;
this.age = age;
this.city = city;
}
let armin = new ConstructObjectArrow("Armin", 32, 'London');
console.log(armin);
the output is: ConstructObjectArrow {} and it has a proto not undefined as the documentation said.