Beginner here working my way through the ‘Basic Algorithm Scripting’ section of FCC. This question relates to ‘Basic Algorithm Scripting: Title Case a Sentence’ but indirectly.
Would someone please explain to me my misunderstanding here?
I would expect the following code to produce arr = [‘Red’,‘blue’,‘green’]
let arr = [‘red’,‘blue’,‘green’];
arr[0][0] = arr[0][0].toUpperCase();
console.log(arr);
But this outputs: ‘red’,‘blue’,‘green’
I have a feeling it has something to do with strings vs. arrays but i’m not really sure.
Also what is the code that would produce arr = [‘Red’,‘blue’,‘green’]?
Thanks in advance!