Can Some explain to why is this code not working in sololern JavaScript playground | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 2

Can Some explain to why is this code not working in sololern JavaScript playground

var name = [1,2,3,4,5]; name.forEach(function add10(name){ name+=10; console.log(name) });

9th Sep 2018, 11:30 AM
George S Mulbah II
George S Mulbah II - avatar
1 Antwort
+ 2
While I can't state offically, I'm guessing because the forEach is a relatively new addition to the language and SoloLearn is slow to update their supported language versions that they haven't gotten to it as yet. There is a huge backwards compatiblility testing that needs to be completed prior to supporting a new version of a language, after all it is better to not support an update than break a million customers usage of the language.
9th Sep 2018, 7:42 PM
John Wells
John Wells - avatar