Message from JavaScript discussions

September 2020

— You can use objects

return ({
[`product:${i}`]: i,


Actually the example was illustrative, but I need to assign something to the variable (a useRef () of react). Objects can't be an alternative here I think...

— I change the question slightly different. What I need is to assign a different variable name for each iteration. How to do this?
I'm thinking something similar to this:

Message permanent page

— I think the only way to do that, is using eval(), but there are risks

— You can use window['string' + var] = something

— Aha… seems a good alternative. Let me try!

— 🙌🙌

— Excatly friend that was perfect! 😊

— Thank you all for you answers!! 🙌

— Ok

— In need 2 get input only integers not lettrs

— /i am just finding which greater with 2 numbers