const randomIntArrayInRange = (min: number, max: number, n: number = 1) =>
        Array.from(
          { length: n },
          () => Math.floor(Math.random() * (max - min + 1)) + min
        );
      
      Typescript language logo

      Random int array in range

      Codiga's TypeScript Recipes

      Generates an array of n random integers in the specified range.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.