javascript use argument code example
Example 1: js unspecified parameters
function my_log(...args) {
// args is an Array
console.log(args);
// You can pass this array as parameters to another function
console.log(...args);
}
Example 2: How to Pass Parameter in JavaScript Function From Html
<!DOCTYPE html>
<html>
<head>
<title>function parameters javascript</title>
</head>
<body>
<button onclick="myfunctionName('rohan')">Click</button>
<script type="text/javascript">
function myfunctionName(a){
alert(a);
}
</script>
</body>
</html>