It was kinda easy project tbh. But I got stuck. But I really Enjoyed it. It took me about almost 2 hours. The link to my repo: https://github.com/SRizvi78/Mixed_Message
1 Like
I have tried my own way. Is there any specific way to do that ? Do you agree with my findings?
//random number generator
const randomNumGen = (num) => {
return Math.floor(Math.random() * num)
};
//random message component in a poperty of string
const randomMessage = {
signComp: ['bright', 'dark', 'totally dark', 'well enough'],
fortuneComp: ['good', 'bad', 'very bad', 'ok', 'fine'],
adviseComp: ['no one', 'all', 'one of them']
}
//variable for taking all message
let allMessage = [];
//message generator function and set some output on allMessage
for (let comp in randomMessage) {
//message generator all property length generator
const numFromRandnum = randomNumGen(randomMessage[comp].length);
This file has been truncated. show original