Message from JavaScript discussions

October 2018

— It depends on how you use it


It is not specific to the constructor itself, whether or not it is a constructor, rather that is defined by its use case

— This applies to most constructors

— You could call TokenLib() with no new

— If with new then it is called as a constructor

— And the instance has a constructor property

— Etc

— In terms of my needs I will turn it into a more typical constructor though, since you reminded me it is not cached haha

Message permanent page

— I think the object literal was likely from older code that was refactored

— Tbh this really annoys me about JS... an undecidable you can only figure out by looking at integrations of the function

Message permanent page

— Unless you use ES6 classes

— It's if you want to return the API instead of object itself