Mixed Message Project

Hi ! the following is my very simple code. I did get familiar with pushing it from local directory to Github repository, and also markdown in readme.md

  • Review of this project: easy
  • Estimate of time to finish: 20 min
  • Code as below
const missionImpossible={ character: ['Ethan Hunt','Ilsa Faust','Solomon Lane','William Brandt', 'White Widow','Julia'], mission:['rescue hostage', 'sit there and look pretty', 'terrorize the city','ride motorcycle around','provide intel analytics', 'smuggle drug'], } const randomNum=()=>{ return Math.floor(Math.random()*6)}; const mission=() => { let result=[]; for (let key in missionImpossible){ switch (key){ case 'character': result.push(`Your name is ${missionImpossible[key][randomNum()]}.`); break; case 'mission': result.push(`Your mission is to ${missionImpossible[key][randomNum()]}.`); break; } } result.push(' :D '); return result.join(' '); }; console.log(mission());
1 Like

Excellent work and what a speedy completion time! On to the next one. :muscle:

1 Like