Readme example not calling constructor with new?
daniellizik opened this issue · 1 comments
daniellizik commented
<script src="https://rawgit.com/icebob/fakerator/master/dist/fakerator.js"></script>
<script>
//no new?
var fakerator = Fakerator();
var name = fakerator.names.name();
var user = fakerator.entity.user();
</script>
The node example uses new
. Is the usage actually different?
icebob commented
In case of localized packages, the main class has a wrapper function, which create the new instance. So when you are using the library the new
is not neccessary. https://github.com/icebob/fakerator/blob/master/lib/index.js#L37