code: public Scriptable newArray(Scriptable scope, Object[] elements)
      {
          if (elements.getClass().getComponentType() != ScriptRuntime.ObjectClass)
              throw new IllegalArgumentException();
          NativeArray result = new NativeArray(elements);
          ScriptRuntime.setBuiltinProtoAndParent(result, scope,
                  TopLevel.Builtins.Array);
          return result;
      }
docs: Create an array with a set of initial elements.
  
  @param scope the scope to create the object in.
  @param elements the initial elements. Each object in this array
  must be an acceptable JavaScript type and type
  of array should be exactly Object[], not
  SomeObjectSubclass[].
  @return the new array object.