What are the pros/cons of using module pattern versus a simple object constructor like this?:
function Car() {
var _mileage = 123;
this.bar = function() {
console.log(_mileage);
}
}
Both allow for private variables and methods, then why and when is module pattern needed or recommended?
Thanks in advance!
classalready.#infront of it? like#mileage = 123;