+ 2
JavaScript Challenge
Can someone please explain this question and answer? I don’t remember covering this in the JS tutorial. Thank you. What is the output of this code? let p= [4,3,2]; let q= p.map((v,w) => v*w); console.log (q);
7 ответов
+ 3
Thank you, Professor Solomoni Railoa for switching on the 💡. I believe I have my shoes on the correct feet now, thanks to your awesome explanations! 🙏
+ 1
Harsh Bajpai 🇮🇳 That’s the correct answer, but I still don’t understand how/why that is the correct answer.
Actually, [0,3,4] as an array.
+ 1
I went back and reviewed ES6 Map. Evidently, that’s not the same as what this question requires.
+ 1
it returns an array
like this--> [0, 3, 4]
because you are multiplying values with an index of the array
Thank You