WHAT'S NEW?

JavaScript :: Method Overloading :: Series 4

If you are coming from Java/C# background, I am sure that you all know about method overloading as one of the OOPS concepts. So, let us see how JS works with method overloading.
Let us try to understand if JS support method overloading or not.

Now, let us send 3 parameters/arguments to the method.
Now, let us create another method with the same name "add" that takes 3 parameters/arguments.
Thus we can conclude that JS does not allow us to have method overloading. JS complier considers the last method in the line of execution with the same name as the method to be executed.

0 comments:

Post a Comment