Example analysis of javascript function characteristics

  • 2020-06-12 08:30:06
  • OfStack

In this paper, the characteristics of javascript function are analyzed. Share to everybody for everybody reference. The specific analysis is as follows:


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>javascript Function characteristics ( important )</title>
<script type="text/javascript">
  function show() { // Note that this function is declared without defining any parameters passed in 
    // Print out all the parameters passed in 
    for (var x = 0; x < arguments.length; x++) {
      alert(arguments[x]);
    }
  }
  show(6, 7, 8, 9);
  // Notice that I passed it in here 4 The number of parameters, and show Function without defining the parameters passed in. 
  var x = show; // Note that there show No parenthesis 
  alert(x); // Notice the output 
</script>
</head>
<body>
</body>
</html>

Hopefully, this article has been helpful in your javascript programming.


Related articles: