Badge granted! One stylistic comment is that your array numbers can be in a single line:
let numbers = [4, 10, 5, 7, 13, 20];
Badge granted! One stylistic comment is that your array numbers can be in a single line:
let numbers = [4, 10, 5, 7, 13, 20];
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> Sum Up an Array of Numbers </title>
</head>
<body>
<script>
let numbers = [4, 10, 5, 7, 13, 20];
let summation = 0;
function arraysum(){
for(let i=0; i<numbers.length;i++)
{
let sum1 = numbers[i];
summation += sum1;
}
console.log(summation);
}
arraysum();
</script>
</body>
</html>
@carlcortez1 - nicely done! You have been granted the badge
:: Copyright KIRUPA 2024 //--