Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Level 7 lesson 1( What is an Array? )

We have created an array with subject names. And have used index to access the first element of the array. As we have string values in the array, we want you to print the length of the first array element.

We already have mentioned the code in console.log() for accessing the first array element, all you have to do is get the length of that string.

let subjects = ["HTML", "CSS", "JavaScript", "Php", "Bootstrap"];

console.log(subjects[0]);

can someone pls provide me the correct code....I am stuck at this.
by

2 Answers

kshitijrana14
Try this one

let subjects = ["HTML", "CSS", "JavaScript", "Php", "Bootstrap"];

console.log(subjects[0].length);
doua
the console print "try again" although every thing is correct. what should i do? btw my code is same as yours

Login / Signup to Answer the Question.