InterviewHubPRO
Section Overview
Q342

Question 342 of 521

Part 6: Async Internals, Memory, Microtasks & Web APIs (329 - 403)

66%
JavaScript Internals (521 Qs)•Part 6: Async Internals, Memory, Microtasks & Web APIs (329 - 403)

What is the output of below string expression

javascript
  console.log("Welcome to JS world"[0]);

The output of the above expression is "W". Explanation: The bracket notation with specific index on a string returns the character at a specific location. Hence, it returns the character "W" of the string. Since this is not supported in IE7 and below versions, you may need to use the .charAt() method to get the desired result.