JavaScript Example (Program)
Learn Details

Q. What is the Syntex of Object With Array Value ?



objectNamae.propertyName[indexing no]

  • Example :

    // ex 1 <script>
    var a = {
       fname : ["Ram", "suresh", "Ganesh"],
       lname :["Kumar", "Singh", "Gupta"]
    }
    document.write(a.fname[0]+" "+a.lname[0])
       
    </script>
    Out Put : Ram Kumar