- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is function overloading in JavaScript?
JavaScript does not support Function Overloading. The following shows function overloading −
function funcONE(x,y) { return x*y; } function funcONE(z) { return z; }
The above will not show an error, but you won't get desired results. On calling,
// prints 5 funcONE(5); // prints 5, not 30 funcONE(5,6);
JavaScript does not support function overloading natively. If we will add functions with the same name and different arguments, it considers the last defined function.
- Related Articles
- What are the best practices for function overloading in JavaScript?
- What is overloading in C#?
- What is Overloading in Java?
- Function Overloading and Overriding in PHP
- What is method overloading in C#?
- What is method overloading in PHP?
- What is method overloading in Java?
- What is constructor overloading in Java?
- Function overloading and return type in C++
- Function overloading and const keyword in C++
- What is "function*" in JavaScript?
- Difference Between Function Overloading and Overriding in C++
- What is function chaining in JavaScript?
- What is function() constructor in JavaScript?
- What is super() function in JavaScript?

Advertisements