Welcome to WebmasterServe!

FREE TO JOIN! Join us now to engage in informative and friendly discussions about Webmastering, SEO, SEM, Internet Marketing, Programming, Graphic Design, Online Jobs and more. What are you waiting for? Ready to join our friendly community? It takes just one minute to register.

Dismiss Notice

Join WebmasterServe Forums 
Join the discussion! Have a better idea or an opinion? It takes just one minute to register Click Here to Join

Help Me/Question How To Use Array In Javascrip?

Discussion in 'Javascript and jQuery' started by steve taylor, Feb 19, 2016.

  1. steve taylor

    Yellow Belt

    Joined:
    Feb 12, 2016
    Messages:
    769
    Ratings:
    +25 / -0
    We know that array is the special variable which hold the similar type of data in continuous memory location. How to array can be used by JavaScript and how to create array in JavaScript? How many properties and methods are available to implement array in JavaScript ? Is looping possible in JavaScript.
     
  2. RADHESHYAM GUPTA

    Yellow Belt

    Joined:
    Feb 13, 2016
    Messages:
    362
    Ratings:
    +20 / -0
    Array is a special value which can hold two or more than two values at a same time.
    You can use an array in javascript by this code:-
    <html>
    <head>
    <title></title>
    <Script >
    var Year[ ]; // It is a empty array.
    var Year ['January', 'February', 'March', 'April']; // Array with elements.
    alert(year[2]);
    </script>
    <head>
    <body>
    </body>
    <html>/
     
  3. saurabh mathur

    Yellow Belt

    Joined:
    Nov 8, 2017
    Messages:
    130
    Ratings:
    +2 / -0
    To access array in JavaScript, you will have to use the brackets and a number like this myArray[2]. Array elements do not have all to be same type of value. Arrays are the container like values that can hold other values.

    web hosting
     
  4. Subarna Karki

    White Belt

    Joined:
    May 13, 2019
    Messages:
    6
    Ratings:
    +1 / -0
    The JavaScript Array object is a global object that is used in the construction of arrays; which are high-level, list-like objects.

    var fruits = ['Apple', 'Banana'];

    console.log(fruits.length);
     

Share This Page