ReactiveX / learnrx

A series of interactive exercises for learning Microsoft's Reactive Extensions Library for Javascript.
1.4k stars 292 forks source link

Exercise 13 - Should return be removed? #140

Open vishalsodani opened 8 years ago

vishalsodani commented 8 years ago

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

`

thomasvanlankveld commented 8 years ago

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