mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-03 05:02:01 -05:00
22 lines
420 B
JavaScript
22 lines
420 B
JavaScript
import words from './words.json';
|
|
|
|
function randomItem(arr) {
|
|
return arr[Math.floor(Math.random() * arr.length)];
|
|
}
|
|
|
|
export function randomQuote() {
|
|
return randomItem(words.motivationalQuotes);
|
|
}
|
|
|
|
export function randomPhrase() {
|
|
return randomItem(words.phrases);
|
|
}
|
|
|
|
export function randomVerb() {
|
|
return randomItem(words.verbs);
|
|
}
|
|
|
|
export function randomCompliment() {
|
|
return randomItem(words.compliments);
|
|
}
|