If an array with name as "names" contain three elements, then how will you print the third element of this array?



If an array with name as "names" contain three elements, then how will you print the third..

Answer / Kori Ravindra Kumar Ramnihor

To print the third element of an array named 'names', you can use bracket notation. For example: console.log(names[2]);

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

What is missing in my code? function numberTally(numList) { var evenTotal = 0; var oddTotal = 0; for (var i = 0; i <= numList.length; i++) { if i % 2 { // i is odd oddTotal += numList[i]; // or oddTotal = oddTotal + numList[i]; } else { // i is even evenTotal + numList[i]; } } alert(oddTotal); return evenTotal; }

1 Answers  


what is the difference between window & document in javascript?

1 Answers  


what is the purpose of using jsp?

1 Answers  


Why extending array is bad idea?

1 Answers  


What does javascript do?

1 Answers  


How to write a function in javascript?

1 Answers  


If an array with name as "names" contain three elements, then how will you print the third element of this array?

1 Answers  


What's the Difference Between Class and Prototypal Inheritance?

1 Answers  


Hi Friends, I am new to java, please provide some use full docs, and where can i get basic Java script docs... thanx in advance

8 Answers  


What is the difference between a web-garden and a web-farm?

1 Answers  


What are exports and imports?

1 Answers  


How to import all exports of a file as an object.

1 Answers  


Categories