Found the project easy to do. Took me about two hours, including how to work with Git and Github. You can check out the project here: First commit · epekho/mixedMessage@1db26a0 · GitHub
Good work @alepho!
I don’t think there is anything I would change.
Perhaps only to use template strings when compiling randomMessage
at the end.
But that’s just a matter of personal preference.
Otherwise, good stuff!
this feels somewhat repetitive:
let subjectLength = messageComponents.subject.length;
let verbLength = messageComponents.verb.length;
let endingLength = messageComponents.ending.length;
let subjectIndex = Math.floor(Math.random() * subjectLength);
let verbIndex = Math.floor(Math.random() * verbLength);
let endingIndex = Math.floor(Math.random() * endingLength);
maybe you could write a function to eliminate duplicate logic? Or use a loop? (not sure looping objects has been taught as this point)
2 Likes