you-dont-need / You-Dont-Need-Loops

Avoid The One-off Problem, Infinite Loops, Statefulness and Hidden intent.
1.07k stars 49 forks source link

Fix missing close curly bracket #14

Closed Lai-YT closed 12 months ago

Lai-YT commented 1 year ago

It seems like we're missing a close curly bracket (}), which encloses the body of the Tail recursive sum function.

const sum = list => {
  const go = (acc, xs) =>
    xs.length === 0
      ? acc
      : go(acc + first(xs), rest(xs));
  return go(0, list) 
}  // <- this one is missing

English ver. and Korean ver. are both fixed 😄 Thank you for making such great repo 🚀