How can i concatenate var names to declare new vars in javascript?:
var foo = 'var';
var bar = 'Name';
How can i declare variable varName?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try something like:
do not use the eval function unless you are absolutely certain about what’s going in. window[] is much safer if all you’re doing is variable access