Javascript window variable in Jquery selector
<p>I'm trying to optimize code but getting some errors. These execute correctly:</p>

<pre><code>Array.prototype.forEach.call( $('ZA1 .stat'), function( td ) {//ExcuteCode}
Array.prototype.forEach.call( $('ZA2 .stat'), function( td ) {//ExcuteCode}
Array.prototype.forEach.call( $('ZA19 .stat'), function( td ) {//ExcuteCode}
Array.prototype.forEach.call( $('ZA20 .stat'), function( td ) {//ExcuteCode}
</code></pre>

<p>Tried to condense to this but getting errors:</p>

<pre><code>for (var trType in allTr) {
    //console.log(trType);
    Array.prototype.forEach.call( $( window[trType]+' .stat'), function( td ) {
    //Excute Code
    }
</code></pre>

<p>In console, I get the following error:</p>

<p>Uncaught Error: Syntax error, unrecognized expression: [object Object] .stat </p>

<p>Can I use window[] in a jquery selector?</p>
