Thank you for your response, @Greenamberred. I think I get what you're saying. Please correct me if I'm wrong:
If a 'var' or 'let' is already an array of Ints, you cannot use .map() to transform it into an array of strings and assign it back to the same 'var' or 'let'. The best you can do, is to use .map() to transform it into an array of strings, and assign it to a different 'var' or 'let'.
In other words, once a 'var' or 'let' datatype is set, .map() is not going to let you change it. "Find another 'var' or 'let'," it says, "This one's taken." —— Am I right?
Also, for my deeper understanding, imagine this:
- You have a basket of normal eggs.
- You use .map() to transform them into Fabergé eggs.
- Now you want the cashier to put the Fabergé eggs back into the same basket you had the normal eggs in.
- The cashier does a backflip and says, "No way! That basket is for normal eggs! Don't you have any sense? If you want to store Fabergé, you need a NEW basket. Extra charges apply."
- So I cough up a new 'basket', and now I have a brand new basket, full of Fabergé.
Question: What happens to my original basket, and the normal eggs it contains?
Answer 1: Both the original basket and the normal eggs are still there (because the normal eggs were only used as a stencil by .map() to create entirely new, separete entities of Fabergé. The normal eggs were actually left untouched in its original basket).
Answer 2: Original basket is there, but it is now empty because every normal egg was tranformed into Fabergé by .map(), all of which were then put into a new basket meant only for Fabergé. So I don't have the normal eggs anymore, they're gone, but I can use the original basket to store new normal eggs (and nothing else), anytime I want.
Answer 3: Original basket is gone. Poof. All the normal eggs are gone. Poof. I'll never get them back, just like my youth. Poof.
Answer 4: None of the above. Please uninstall XCode.
Looking forward to your answers.