Ask Question
3 September, 19:24

In Js how will you declare and intialize an obejct an array

+4
Answers (1)
  1. 3 September, 21:43
    0
    In jа vascript array are the special type of object, to store the multiple value in single variable we used array in jа vascript.

    Explanation:

    We can create an array in jа vascript by using following syntax

    var arrayname=[value1, value2 ... valuen];

    For example:

    var st=["san","ran", tan"];

    In jа vascript array are treated as object.

    we can declare and initialize an object of array

    var st=["san","ran", tan"]; / / declaring array

    document. getElementById ("d2"). innerHTML = st[0]; / / accessing the member of array by array object.

    In this st object access the first element in the array.

    Following are implementation of declare and initialize an object an array

    Output:

    san
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “In Js how will you declare and intialize an obejct an array ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers