Last active
October 4, 2023 20:04
-
-
Save sethdavis512/2f8e0ecc51f572a72c640a655d3ca41f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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