Home  >  Article  >  Web Front-end  >  Examples of using ubound function in JavaScript_javascript skills

Examples of using ubound function in JavaScript_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:32:071429browse

The ubound function method in JavaScript returns the maximum index value used in the specified dimension of VBArray. How to use:

Copy code The code is as follows:

safeArray.ubound(dimension)

SafeArray is a required option. is a VBArray object.
dimension is optional. The dimensionality of the VBArray whose index upper bound is to be known. If omitted, ubound treats this parameter as 1.

If the VBArray is empty, the ubound method will return undefined. This method will generate a "subscript out of bounds" error if dim is greater than the dimension of the VBArray or is negative.

Example

The example below consists of three parts. The first part is the VBScript code used to create a Visual Basic safe array. The second part is the JScript code that determines the dimensions of the safe array and the upper bound of each dimension. Both parts are placed in the section of the HTML page. The third part is the JScript code located in the section, which runs the other two parts.

Copy code The code is as follows:






Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn