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

Examples of using ubound function in JavaScript_javascript skills

WBOY
Release: 2016-05-16 16:32:07
Original
1469 people have browsed it

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:






Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template