eloquent javascript exercise 4:2

In this example below you will see how to do a eloquent javascript exercise 4:2 with some HTML / CSS and Javascript

eloquent javascript... the solution of sum of range exercise on chapter 4...

This awesome code was written by 241188, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright 241188 ©
  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

  <meta charset="UTF-8">
  <title>eloquent javascript exercise 4:2</title>



    <script  src="js/index.js"></script>



/*Downloaded from https://www.codeseek.co/241188/eloquent-javascript-exercise-42-GjWbyY */
var arr=[] 
  function range(start,end,step){ 
    if(step==null) step=1;
   for(var x=start; (x+step)<(end+step+1) ;x=x+step) 
      return arr
function sum() {
  var result=0
  for(var y=0; y<arr.length;y++)
    return result