Consider this situation.
new Promise(function(resolve, reject) {
var x = resolve(2);
});
What value will x
be?
I tried to print it and it showed me undefined
. It is intuitive, but is it always so? Is it in docs?
Second question
new Promise(function(resolve, reject) {
resolve(2);
return 5;
});
What should we return from the function that we put into a promise? Is this value ignored?