let billiardsfun = () => { let keycode = generatekeycode(); for(let i = 0; i < keycode.length; i++) { if(keycode[i] === 'rekindle') { console.log('time to rekindle your love for billiards!'); } else if(keycode[i] === 'avoid') { console.log('avoid pre-starting your stroke; wait for the perfect moment.'); } else if(keycode[i] === 'news') { console.log('stay updated with the latest billiards news to improve your game.'); } } }; billiardsfun();