Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript Sum of a sequence

const sequenceSum = (begin, end, step) => {
  let sum = 0
  for (let i = begin; i <= end; i += step) sum += i;
  return sum
};
console.log(sequenceSum(2, 6, 2))

// With love @kouqhar
Source by www.linkedin.com #
 
PREVIOUS NEXT
Tagged: #javascript #Sum #sequence
ADD COMMENT
Topic
Name
5+1 =