What does this JavaScript code log and why?

Codeguage - Feb 5 '24 - - Dev Community

Q. What does the following code log?

var s = 'Good';
s[0] = 'F';

console.log(s);
Enter fullscreen mode Exit fullscreen mode

Why is the output what it is?

. . . . . . . . . . . . . . . . . . . . .