learnrx icon indicating copy to clipboard operation
learnrx copied to clipboard

Exercise 13 - Should return be removed?

Open vishalsodani opened this issue 9 years ago • 1 comments

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"]';

`

vishalsodani avatar Feb 18 '16 09:02 vishalsodani

I get SyntaxError: Illegal return statement (but works fine after removing return statement)

thomasvanlankveld avatar May 19 '16 15:05 thomasvanlankveld