I have a requirement like, i need to execute a js code for some screens in my application and i need to name the function with viewid like myScreen1().. myScreen3().
But as the function definition is same for all the function names, is there any way to declare such that all the function names will refer to same definition?
Following will work, but maybe you should rethink your design as most likely it is also possible using only one function name.
var func = function() {
// definition goes here
}
var myScreen1 = func;
var myScreen2 = func;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With