Closed pdawyndt closed 4 weeks ago
This is the case because we currently use the constructor to detect if something is a "plain" object: value?.constructor === Object
.
We can of course add a special case for objects created with Object.create(null)
, but is this what we want? I ask, since it isn't entirely clear to me what we should do, since:
> Object.create(null) === {}
false
> Object.create(null) == {}
false
Initializing a JavaScript object as
{}
or asObject.create(null)
should make no difference when checking object equality. However, this is currently not the case.Example: https://dodona.be/exercises/1331474531/ To reproduce: replace
{}
byObject.create(null)
in sample solution; where sample solution is evaluated as correct, the modified solution is not