title: Filter an array of objects against array of strings
body: <p>That returns an empty array. I have also tried using the array of <code>selectedRules[0]</code> itself but got same result. How can we do the comparison of filter on an array of objects against an array of strings to return an array of objects with each filtered rule?</p>
  
  <pre><code>   const allRules = [
        {
         RuleName: "Two",
        RuleId: 2
          },
          {
            RuleName: "Three",
           RuleId: 3
          },
        {
          RuleName: "Four",
          RuleId:4
        }
      ];
  
      const selectedRules = ["2", "3"]
  
      const filteredRule = allRules.filter(x =&gt; x.RuleId === selectedRules)
  
      console.log(filteredRule) // []
  </code></pre>