Java Insert Element Into Array Javascript Append