I'm trying to use javax.script.ScriptEngine to eval() some JS scripts.
How can I know if the result after eval() which is of type Object is an array? And if so, how can I cast it?
Right now, to know if the object is of type Number or of type String i use instanceof. And when the result of the script is an array, if I print with System.out.println() the object returned it simply prints [object Array].