Closed JesterCheung closed 5 years ago
The in
operator uses the strict equality operator (===
), so the types need to match. Your usage of and
is fine, but the right side should be "3" in str
. For reference, here's a complete example that should do what you expect:
var parIn = new Parser({ operators: { 'in': true } });
parIn.evaluate('3 in array and "3" in str', { array: [ 1, 2, 3 ], str: "123" });
sometimes like : parIn.evaluate('3 in array and 3 in "%str%"', { array: [ 1, 2, 3 ],str:"123" }))