Home >Web Front-end >JS Tutorial >Example analysis of javascript function characteristics_javascript skills

Example analysis of javascript function characteristics_javascript skills

WBOY
WBOYOriginal
2016-05-16 15:58:591295browse

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn