I want to create a local variable dynamically. JavaScript: Dynamically Creating Variables for Loops is not exactly what I am looking for. I dont want an array. I want to access
Do you need something like this?
function createVariables(properties, context){ for( var variable in properties){ context[variable] = properties[variable ]; } }
So, calling as createVariables(properties, this) will fill the current scope with values from properties.
createVariables(properties, this)
properties