Convert string to variable name in JavaScript

If it’s a global variable then window[variableName]
or in your case window["onlyVideo"] should do the trick.

Leave a Comment