Results 1 to 3 of 3
  1. #1
    Senior Member dennis123's Avatar
    Join Date
    Apr 2013
    Location
    Bangalore
    Posts
    931

    How to create arrays in javaScripts?

    How to create arrays in javaScripts?

  2. #2
    There are two syntaxes for creating an empty array: let arr = new Array(); let arr = [];. Almost all the time, the second syntax is used.

  3. #3
    Registered User
    Join Date
    Feb 2014
    Location
    delhi
    Posts
    438
    An array where the length is greater than the amount of numbered properties is known as a sparse array while one with the length equal to the number of numbered properties is a dense array.

    //Creates an array with no numbered entries

    var arr = new Array(5);
    test(arr);
    // length: 5

    var arr = [];
    arr.length = 5;
    test(arr);
    // length: 5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

  Find Web Hosting      
  Shared Web Hosting UNIX & Linux Web Hosting Windows Web Hosting Adult Web Hosting
  ASP ASP.NET Web Hosting Reseller Web Hosting VPS Web Hosting Managed Web Hosting
  Cloud Web Hosting Dedicated Server E-commerce Web Hosting Cheap Web Hosting


Premium Partners:


Visit forums.thewebhostbiz.com: to discuss the web hosting business, buy and sell websites and domain names, and discuss current web hosting tools and software.