pazams/go-for-javascript-developers

Syntax error in JS sequential code snippet

itaditya opened this issue · 3 comments

In the snippet

function fetchSequential() {
    fetchA().then( (a) => {
        console.log(a);
        return fetchB();
    }.then( (b) => {
        console.log(b);
        return fetchC();
    }.then( (c) => {
        console.log(c);
    }
}

The closing paranthesis of .then() are missing.

The correct snippet would be

function fetchSequential() {
    fetchA().then( (a) => {
        console.log(a);
        return fetchB();
    }).then( (b) => {
        console.log(b);
        return fetchC();
    }).then( (c) => {
        console.log(c);
    })
}

Good catch!
Your suggest here #17 should fix this.

Yes !!

Fixed with #22