I was reading on "professional javascript for web developers" when the author said :
The constructor property was originally intended for use in identifying the object type. However, the instanceof operator is considered to be a safer way of determining type
can you explain what is the concern behind not using constructor
over instanceof
to determine object type?
traditional example with no differences maybe like:
car instanceof Car // true
car.constructor === Car // true
Thanks...