Here you can find the source of addToArray(final Object array, final Object value)
public static void addToArray(final Object array, final Object value)
//package com.java2s; //License from project: Apache License import jdk.nashorn.api.scripting.ScriptObjectMirror; public class Main { public static void addToArray(final Object array, final Object value) { ((ScriptObjectMirror) array).callMember("push", value); }// w w w . ja va 2 s . c o m }