19 lines
		
	
	
		
			341 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
		
		
			
		
	
	
			19 lines
		
	
	
		
			341 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
|   | import words from './words.json'; | ||
|  | 
 | ||
|  | 
 | ||
|  | function randomItem(arr) { | ||
|  |   return arr[ Math.floor(Math.random() * arr.length) ]; | ||
|  | } | ||
|  | 
 | ||
|  | export function randomPhrase() { | ||
|  |   return randomItem(words.phrases); | ||
|  | } | ||
|  | 
 | ||
|  | export function randomVerb() { | ||
|  |   return randomItem(words.verbs); | ||
|  | } | ||
|  | 
 | ||
|  | export function randomCompliment() { | ||
|  |   return randomItem(words.compliments); | ||
|  | } |