Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How to determine if an argument is sent to the JavaScript function?
To determine if an argument is sent to function, use “default” parameters.
Example
You can try to run the following to implement it
<!DOCTYPE html>
<html>
<body>
<script>
function display(arg1 = 'Tutorials', arg2 = 'Learning') {
document.write(arg1 + ' ' +arg2+"<br>");
}
display('Tutorials', 'Learning');
display('Tutorials');
display();
</script>
</body>
</html> Advertisements
