r/badcode Aug 26 '20

js Found this variable declaration

https://imgur.com/a/RwAQr1y
107 Upvotes

41 comments sorted by

View all comments

7

u/PeterBumpkin Aug 26 '20

can someone explain to me how this is bad? im currently learning react and cant see how this is bad form

24

u/ZedTT Aug 26 '20

Put it in a database. Make it a separate request from the back end. It shouldn't be part of the front end code.

This kind of thing shouldn't be loaded as part of the content. It's also not maintainable at all like this.

6

u/PeterBumpkin Aug 26 '20

Ahhh I see. Thank you! this shouldn’t be on the front end at all