Sum Up an Array of Numbers : Frontend Coding Exercise

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Sum an Array of Numbers</title>
</head>
<body>
  <script>
    let numbers = [4, 10, 5, 7, 13, 20];
    let sum = 0
    numbers.forEach(num => sum += num)
    console.log(sum)
  </script>
</body>
</html>
1 Like