Ask Question
18 July, 02:54

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

+2
Answers (1)
  1. 18 July, 05:26
    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?
Get an answer to your question ✅ “In Js how will you declare and intialize an obejct an array ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers