Skip to main content
InterviewHubPRO
Section Overview
Q342

Question 342 of 536

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

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

What is the output of below string expression

senior LevelCode ExampleAsync & PromisesEvent LoopHTTP & REST APIs
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.