I have a Java applet that has an int array. I want to copy this array over to a JavaScript array. Simply calling a Java function from JavaScript that returns this array results in null exception and accessing the array element by element from JavaScript leads to browser crashes. What is the correct way to handle this? Perhaps JSObject?