uso de arr.foreach () em javaScript

<! DOCTYPE html>
<html lang = "pt">
  <head>
    <meta charset = "UTF-8" />
    <meta name = "viewport" content = "width = largura do dispositivo, escala inicial = 1.0" />
    <title> Documento </title>
    <script>
      var arr = [12,13,15];
    // O valor atual subscrito está na matriz
       arr.forEach ((valor, índice, arrs) => {
           console.log (índice + ">>>>>>>" + valor + "" + arrs);
       })
    </script>
  </head>
  <body>
  </body>
</html>

Acho que você gosta

Origin www.cnblogs.com/kukai/p/12755512.html
Recomendado
Clasificación