This article describes how to use the ubound function in JavaScript. This article first explains the syntax of the ubound function, and then provides an example of the usage code, you can refer to the ubound Function Method in JavaScript to return the maximum index value used in the specified dimension of VBArray. Usage:
The Code is as follows:
SafeArray. ubound (dimension)
SafeArray is required. Is a VBArray object.
Dimension is optional. You need to know the dimension of the VBArray on the upper bound of the index. If this parameter is ignored, ubound treats this parameter as 1.
If VBArray is empty, the ubound method returns undefined. If dim is greater than the dimension of VBArray or is a negative number, this method will generate a "subscript out of bounds" error.
Example
The following example consists of three parts. The first part is the VBScript code used to create a Visual Basic security array. The second part is the JScript code to determine the dimension of the security array and the upper bound of each dimension. Both are on the HTML page.. The third part is locatedThe JScript code is used to run the other two parts.
The Code is as follows: