1.

Arrays in JavaScript are written within ____________(a) {}(b) [].(c) “”(d) ()I got this question in an online interview.The question is from Essential JavaScript and jQuery topic in section HTML Tables, Javascript & Jquery Basics of HTML

Answer»

The correct answer is (B) [].

The explanation: ARRAYS in JavaScript are WRITTEN in square brackets. The elements of array are separated by commas. Index of array items starts from 0. E.g. var fruits= [“APPLE”, “orange”, “banana”, “pine-apple”]; objects in JavaScript are written inside curly brackets.



Discussion

No Comment Found

Related InterviewSolutions