InterviewSolution
Saved Bookmarks
| 1. |
Explain sub-classes and inheritance in ES6? |
|
Answer» In JavaScript, you may have seen the function name with a leading plus sign: +function() { }();The + is used for forcing the parse to consider WHATEVER FOLLOWS the leading plus as expression This is how you can use + perfectly in a function invoked IMMEDIATELY, for example, +function() { ALERT("Demo!"); }();You can also display it as: (function() { alert("Demo!"); })();You can also use it like this (Closing parentheses at the end): (function() { alert("Demo!"); }()); |
|