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