Random super hero message

Hello coders!!! I’m here asking for your opinions on the way I solved this portafolio project. I found it easy to solve, however, I’m not enterily sure of how good my solution was.

my project

Thank you! and happy coding

1 Like

Looks good you got it to work. Now what i would suggest to improve the code and you can do it in steps and once done you can try to expand it by adding an HTML front end to display the messages
You can start by:

  • first looking for pitfalls in your code. example if(message == 'Hulk: '){ // on line 14 should be using === instead.

  • looking for some structural/ technical debts or defects in your code. Are you utilizing all the variables defined(i.e. messageMaterial object)? Analyze the state or value of variables in your code(i.e the message object at each step of the loop to know what its value is)?

  • Lastly looks at the best data structure to use for your data. should you use a map or a list for each key etc

cheers

Oh yes, I’m kind a use to C/C++, that’s why I sometimes use “==” instead of “===”, I will correct that! For the HTML suggestion, once I finish the HTML first section (I’m doing the full stack path) I will add that! Thanks a lot for your comments!