The ubound function in JavaScript uses the example _ javascript Technique

Source: Internet
Author: User
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:



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.