2
When I’m in PHP
and has dynamic variables, e.g.: nomeVariavel1
,nomeVariavel2
, nomeVariavel3
,
I use it as follows to place on the bench:
$nomeVariavel = ${"nomeVarivavel".$contador}
How can I do exactly that in Javascript? Passing as parameter or otherwise?
Possible duplicate of Dynamically create variable
– MarceloBoni
Possible duplicate of https://answall.com/questions/122604/howto create a variable-din%C3%A2mica
– MarceloBoni
I think there might be a duplicate but I don’t think these are, at least not for something so simple.
– Maniero
Did any of the answers solve your question? Do you think you can accept one of them? Check out the [tour] how to do this, if you haven’t already. You would help the community by identifying what was the best solution for you. You can accept only one of them. But you can vote on any question or answer you find useful on the entire site.
– Maniero