title: how to get a value in array of variables by using a string
body: <p>filteredArray is an array of variables So, I want to get a variable from it by searching in to it using a string and I want directly to use this variable in another code, can you help me?</p>
  <pre><code>     
        const filteredArray = [livingRrooms, kitchens, ceilingsDesigns, bedroomsArray ];
      // z is the string I get from a code that i have
           const z = &quot;livingRrooms kitchens ceilingsDesigns bedroomsArray&quot;;
             function checkvar(cas) {
                 return z.includes(cas);
                                   }
        // as you can see next line is working just find     
             console.log(checkvar(&quot;kitchens&quot;));
       // this dosn't work because find use a srtict mode I need a way around it or anonther way
             console.log(filteredArray.find(checkvar));
  </code></pre>