This question already has an answer here:
How do I get "my_param" as a string so that I can use it as a key in the has I am trying to create?
var my_function = function(my_param) {
var my_hash = {
my_param: "foobar"
}
}
This question already has an answer here:
How do I get "my_param" as a string so that I can use it as a key in the has I am trying to create?
var my_function = function(my_param) {
var my_hash = {
my_param: "foobar"
}
}
This is bracket notation, where
a.b = 'c'
is the same asa['b'] = 'c'
.You'll want to use bracket notation: