About JS two-dimensional array and multidimensional array definition statement (detailed) _javascript skills

Source: Internet
Author: User
Tags array definition

Declare one-dimensional array: var goodsarr = [];

assignment:goodsarr[0] = ' value ';

This is not controversial, because the usual use of PHP is more, and PHP syntax can be directly used goodsarr[0] = ' a '; This method declares an array and assigns it, but JS cannot use it, and must declare the existence of the array first. Similarly, if you are a two-dimensional array, you must declare a two-dimensional and multidimensional array before use, for example, a two-dimensional array:

var goodsarr[0] = [];

You must first declare a two-dimensional array to use a two-dimensional array, or you will get an error.

The above is a small series for you to bring to the two-dimensional and multidimensional array of JS definition statement (detailed) of the entire content, I hope to help you, a lot of support cloud Habitat Community ~

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.