javascript - Search with a variable in array -
i trying search array variable, seems not work because thinks variable value.
var variable = "create"; var navviews = { "create" : [ { "id" : "1", "name" : "create", "urlext" : "stylecreator" } ] } navviews.variable;
how reach "create" through variable?
if want create array
, can in way:
navviews[variable]
Comments
Post a Comment