首页 > 代码库 > javascript forEash写法

javascript forEash写法

<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Chain Array</title>
  </head>
  <body>
    <script>
    balls = ["aa","bb","cc"];
    function henry (_this, i) {
        alert(_this + i)
    }
     balls.forEach(henry);
    </script>
  </body>
</html>

javascript forEash写法