const sumN = (n: number) => (n * (n + 1)) / 2;
      
      Typescript language logo

      Sum all numbers

      Codiga's TypeScript Recipes

      Sums all the numbers between 1 and n.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.