jquery - javascript variable to call object function -
this question has answer here: dynamically access object property using variable 10 answers i'm new oop, please excuse me if terminology off. i'm trying use function parameter call object argument. i think more understandable sample code: js $(".color").click(function() { var newcolor = $(this).attr("data-color"); functions.colors.show(newcolor); }); var functions = { colors: { show: function(newcolor) { $("h1").text(mytexts.test.newcolor); } } } // end functions var mytexts = { test: { red: "bright red", green: "grassy green", blue: "sky blue" } } // end texts as can see, i'm trying get, say, "sky blue", show inside h1. however, when click, say, show "bright red", not working