Is it ok to assign the JavaScript prototype object instead of just its properties?

The biggest reason not to use the 2nd form is that you’ll end up eliminating anything else that existed in the prototype before you assign it. If that isn’t something you’re concerned with there’s no reason not to declare it the way you’ve demonstrated.

Leave a Comment