Page tree
Skip to end of metadata
Go to start of metadata




Introduced in

Version:1.19

Description

Description: Adds an element to the beginning of an array and returns the array. The input array is also modified by reference.

Syntax

Syntax: [array1, element] call fn_vbs_arrayUnShift
Parameters:
  • array1: Array - Original array
  • element: Anything - Element added to the beginning of array1
Return Value: Array - Note that array1 is also modified by reference

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
_array = [[6,7,8], 5] call fn_vbs_arrayUnShift

Additional Information

See also: fn vbs arrayUnShiftStack (un-shifts multiple items), fn vbs arrayShift (reverse of un-shift), fn vbs arrayPush (adds items to other end of array)
Multiplayer: 
Problems: 

Notes