Exercise 13 - Should return be removed?
vishalsodani opened this issue · comments
Vishal Sodani commented
When I remove the below commented lines I get an error; return not in function. And, if I remove return before JSON.stringify it works.
var spanishFrenchEnglishWords = [ ["cero","rien","zero"], ["uno","un","one"], ["dos","deux","two"] ];
// collect all the words for each number, in every language, in a single, flat list
var allWords = [0,1,2].
concatMap(function(index) {
return spanishFrenchEnglishWords[index];
});
return JSON.stringify(allWords) === '["cero","rien","zero","uno","un","one","dos","deux","two"]';
`
Thomas van Lankveld commented
I get SyntaxError: Illegal return statement
(but works fine after removing return
statement)