Syntax error in JS sequential code snippet
itaditya opened this issue · 3 comments
itaditya commented
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);
})
}
itaditya commented
Yes !!