Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
Convert string value as variable name in js, like in php
Asked
Jul 09 '17 at 14:15
Active
Jul 09 '17 at 14:15
Viewed
25 times
0
I would like to do this in JS,like in php, example.
Is it possible?
javascript
string
variables
asked Jul 09 '17 at 14:15
Carlos Diaz
321
1
15
This is a bad idea and you should stop wanting to do that.
–
melpomene
Jul 09 '17 at 14:21
Is not bad idea, that is saving me lot of repetitive lines of codes in php and I can do lot of kind of dynimic functions, saving many many lines of codes.
–
Carlos Diaz
Jul 09 '17 at 14:24
Nima Hakimi, thank you, I didn't saw that post.
–
Carlos Diaz
Jul 09 '17 at 14:25
1
@CarlosDiaz Any time you think you need to do this, you should be using an object instead.
–
Barmar
Jul 09 '17 at 14:43
0 Answers
0