Skip to content

Tag: eval

javascript eval works one way but not the other, why?

I am trying to use eval function for dynamic assignment. I know it is bad practice and have modified the code to not use eval. Still though, I don’t understand why it worked one way but not the other. Here is what worked: What didn’t work: Can someone tell me what’s wrong with the second app…