I made a class in JS (Model ES6), it's working beauty, but how do I put it in an external file and give it a Require Once
as in PHP? Can you do that? Thanks;)
I made a class in JS (Model ES6), it's working beauty, but how do I put it in an external file and give it a Require Once
as in PHP? Can you do that? Thanks;)
It depends on your environment, if you use jQuery in the webbrowser (for a website, for example), you can take a look at the plugins like browserify which make about the require
model of the NodeJS.
If you are using the Node environment, then just use require
itself, but I do not believe there is a require_once
, even because objects are stored in variables, they are not embedded in the environment. >