ArrayPrototype.unshift(Object, Object[]) 方法

定义

将新元素添加到指定数组的开头。Adds new elements to the start of the specified array. 将现有元素位移到后面的位置。Shifts the existing elements to the next positions.

此 API 支持产品基础结构,不能在代码中直接使用。

public:
 static System::Object ^ unshift(System::Object ^ thisob, ... cli::array <System::Object ^> ^ args);
[Microsoft.JScript.JSFunction((Microsoft.JScript.JSFunctionAttributeEnum) 18, Microsoft.JScript.JSBuiltin.Array_unshift)]
public static object unshift (object thisob, params object[] args);
[Microsoft.JScript.JSFunction(Microsoft.JScript.JSFunctionAttributeEnum.HasThisObject | Microsoft.JScript.JSFunctionAttributeEnum.HasVarArgs, Microsoft.JScript.JSBuiltin.Array_unshift)]
public static object unshift (object thisob, params object[] args);
[<Microsoft.JScript.JSFunction((Microsoft.JScript.JSFunctionAttributeEnum) 18, Microsoft.JScript.JSBuiltin.Array_unshift)>]
static member unshift : obj * obj[] -> obj
[<Microsoft.JScript.JSFunction(Microsoft.JScript.JSFunctionAttributeEnum.HasThisObject | Microsoft.JScript.JSFunctionAttributeEnum.HasVarArgs, Microsoft.JScript.JSBuiltin.Array_unshift)>]
static member unshift : obj * obj[] -> obj
Public Shared Function unshift (thisob As Object, ParamArray args As Object()) As Object

参数

thisob
Object

此方法所作用于的对象。The object that this method is acting upon.

args
Object[]

要添加到 thisob 中的元素。The elements to add to thisob.

返回

Object

thisob 的新长度。The new length of thisob.

属性

适用于

另请参阅