Logo
/
Programming
/
JavaScript Course
/

String characters

JavaScript: String characters

Access individual characters using bracket notation with a zero-based index.

const word = 'hello';
console.log(word[0]); // => h
console.log(word[4]); // => o

Instructions

A secret word is hidden in the text string. Extract the needed characters from the text variable by their indexes, join them, and print the word grip.

Tips

If you've reached a deadlock it's time to ask your question in the «Discussions». How ask a question correctly:

  • Be sure to attach the test output, without it it's almost impossible to figure out what went wrong, even if you show your code. It's complicated for developers to execute code in their heads, but having a mistake before their eyes most probably will be helpful.
Found a bug? Have something to add? Pull requests are welcome!