Last active
October 11, 2019 17:30
-
-
Save James-Bovis/d03a5243bfd9c1b6236df446b29ba44e to your computer and use it in GitHub Desktop.
Random Placeholder Text from Array
This file contains 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
const generateRandomPaceholder = (name: string): string => { | |
const placeholders = [ | |
`For example, ${name} loves a good belly scratch and long walks at twilight on the beach.`, | |
`For example, ${name} is a legend and a great dog`, | |
`For example, ${name} is the best dog I could have ever wished for`, | |
`For example, ${name} makes me so happy my heart hurts` | |
] | |
const placeholderText = placeholders[Math.floor(Math.random() * placeholders.length)] | |
return (placeholderText) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment