JavaScript sets 'this' to the global environment by default for calling it like an ordinary function, so it works but your global 'this' object is messed up, when u call the constructor function with new keyword it will create a new 'this' object and will return that with the properties and methods in it.