Skip to content

Instantly share code, notes, and snippets.

@sethdavis512
Last active October 4, 2023 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sethdavis512/2f8e0ecc51f572a72c640a655d3ca41f to your computer and use it in GitHub Desktop.
Save sethdavis512/2f8e0ecc51f572a72c640a655d3ca41f to your computer and use it in GitHub Desktop.
// Arrow
const buildMockArray = <T>(num: number, content: T): T[] => Array(num).fill(null).map(() => content);
// Traditional
function buildMockArray<T>(num: number, content: T): T[] {
return Array(num).fill(null).map(() => content);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment