- 4

var prom=function(){ return new Promise((resolve,reject)=>{ var a=10; resolve(a); reject(a); }) }

Guys Intermediate value .then is not a function I got this error

5th Aug 2021, 2:46 PM
Aniket Ganguly
9 Answers
0
Will u please share your code link
5th Aug 2021, 2:49 PM
Pariket Thakur
Pariket Thakur - avatar
0
Debug: var prom=function(){ return new Promise((resolve,reject)=>{ var a=10; resolve(a); reject(a); }) } prom().then(a=>console.log(a)); or prom().then(result=>console.log(result));
5th Aug 2021, 3:21 PM
Solo
Solo - avatar
0
Debug: var prom=function(){ return new Promise((resolve,reject)=>{ var a=10; resolve(a); reject(a); }) }().then(result=>{console.log(result)});
5th Aug 2021, 3:42 PM
Solo
Solo - avatar
0
Vasiliy i was also coming with the same answer but never mind I was just typing the answer but ....
5th Aug 2021, 3:47 PM
Pariket Thakur
Pariket Thakur - avatar
0
HrCoder, I cannot understand what you mean.
5th Aug 2021, 3:55 PM
Solo
Solo - avatar
- 1
I got this same syntax error
5th Aug 2021, 3:25 PM
Aniket Ganguly
- 3
U copy paste on ur IDE
5th Aug 2021, 2:50 PM
Aniket Ganguly
- 3
var prom=function(){ return new Promise((resolve,reject)=>{ var a=10; resolve(a); reject(a); }) }.then(()=>{console.log(result)}) Guys Intermediate value .then is not a function I got this error
5th Aug 2021, 3:25 PM
Aniket Ganguly
- 4
I don't have broo I only share this code
5th Aug 2021, 2:50 PM
Aniket Ganguly