It is true that JavaScript supports overriding not overloading. When you define multiple functions which has the same name, the last one defined will override all the previously defined ones and every time when you invoke a function, the last defined one will get executed. The following example overrides the user-defined function.
source https://www.c-sharpcorner.com/Blogs/method-overriding-in-javascript
No comments:
Post a Comment