Javascript dynamically invoke object method from string

if the name of the property is stored in a variable, use []

foo[method]();

Leave a Comment