JavaScript has an interesting inheritance mechanism: prototypal. Most of the starting JavaScript developers have hard time understanding it, as well as I had. All types in JavaScript (except the null and undefined values) have a constructor property, which is a part of the inheritance. For example: var num = 150; num.constructor === Number // => true var obj = {}; str.constructor === Object // => true var reg = /\d/g;… Continue reading