Skip to content

Instantly share code, notes, and snippets.

@DarrenSem
Last active December 1, 2023 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DarrenSem/e4b235a77937ba9190fc12b5474ebbd5 to your computer and use it in GitHub Desktop.
Save DarrenSem/e4b235a77937ba9190fc12b5474ebbd5 to your computer and use it in GitHub Desktop.
filledArray.js - create a new array of size 'n' filled with values that result from calls to funcForEachIndex(index) - REPLACED BY: Array.range.js
// REPLACED BY: Array.range.js => new Array( length, optionalEachFunction, optionalMapFunction )
// https://gist.github.com/DarrenSem/bc0403bcdad09912eb298e6d3b4824fe
// previously REPLACED BY: Array.build.js -- sugar for functional equivalent of new Array( length, functionUsingIndex ) aka fillArray(L, F) -- returns Array(length).fill(0).map( (_, i) => callbackFn(i) )
// https://gist.github.com/DarrenSem/bf49d0c87083301a88111b5d444f0a5f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment