Below is some code that I am working with.
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("JavaScript");
engine.eval("[1, 2, 3].contains(1)");
However, when I run the code, it throws the following error:
javax.script.ScriptException: TypeError: [1, 2, 3].contains is not a function in <eval> at line number 1
I found that using indexOf(1) instead seems to work, but I am curious as to why I am unable to use contains with this parser.