This article analyzes the characteristics of javascript functions with examples. Share it with everyone for your 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函数特点(重要)</title> <script type="text/javascript"> function show() { //注意这个函数声明时没有定义任何传入参数 //打印出所有传入的参数 for (var x = 0; x < arguments.length; x++) { alert(arguments[x]); } } show(6, 7, 8, 9); //注意这里传入了4个参数,而show函数时没有定义传入参数的。 var x = show; //注意这里show没有加括号 alert(x); //注意看输出结果 </script> </head> <body> </body> </html>
I hope this article will be helpful to everyone’s JavaScript programming design.