I’ve looked for solutions, but couldn’t find any that work.
I have a variable called onlyVideo
.
\"onlyVideo\"
the string gets passe
The window['variableName'] method ONLY works if the variable is defined in the global scope. The correct answer is "Refactor". If you can provide an "Object" context then a possible general solution exists, but there are some variables which no global function could resolve based on the scope of the variable.
(function(){
var findMe = 'no way';
})();