JavaScript functions have a built-in object called the arguments object. - Javascript Function

Javascript examples for Function:Function Argument

Introduction

The arguments.length property returns the number of arguments received when the function was invoked:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
function myFunction(a, b) {
    return arguments.length;//from   ww  w  .j a v a  2 s  . c o  m
}

document.getElementById("demo").innerHTML = myFunction(4, 3);
</script>

</body>
</html>

Related Tutorials