if __name__ == '__main__' js normal application code example
Example: if __name__ == '__main__' js normal application
var fnName = function() {
// main code
}
if (require.main === module) {
fnName();
}
var fnName = function() {
// main code
}
if (require.main === module) {
fnName();
}