Efforts to make Javascript look just like any other object-oriented programming language succeed in covering up its true philosophy of objects. Javascript is a prototype object language and this ...
Whereas Java and several other programming languages have a wide and rich range of datatypes and collections types, JavaScript only has a small number of primitive datatypes (Boolean, Number, String, ...
There is no reason why you can't pass some parameters to the object factory. In most cases these are typically initialisation parameters of the sort that would be used in a class constructor. As well ...