This user marked this Question
as a duplicate of the following questions
and subsequently composed a canonical Question/Answer
to address the oft posed question as to why a value is
undefined
when logged outside of thePromise
chainundefined
at chained.then()
callback function- the chained
.then()
does not appear to wait for thePromise
result within a function call; or - the chained
.then()
does not appear to wait for a fulfilledPromise
from previous.then()
The purpose of the canonical is to refer to the Question/Answer when the inquiry arises again, to avoid the need to simply state
"no value or
Promise
isreturn
ed from the function call"; or"no value or
Promise
isreturn
ed from preceding.then()
"
However, the duplicate Question has been reopened. OP of the Question answered own Question by stating, in pertinent part,
Based on the comments. Here is the version works. A simple return is missing from original codes
which is the substantial Answer at the canonical Question
Because no
Promise
or other value is returned from.then()
chained toPromise
constructor.
leading to the present inquiry.
What are the rules relevant to duplicate Questions being reopened where there is clearly
a) an existing Answer to the new Question?
b) a subsequent canonical Question/Answer is posted which addresses and provides solutions for not only the current inquiry, but the topic in general?
Do the rules provide for a Question marked as duplicate to be reopened where the re-opening of the new Question results in two or more Question on the exact same topic having the exact same Answer?
Should users simply not mark new questions as duplicates of previous Questions? And continue providing the same Answer at each new Question where a value is not return
ed from a function call or previous .then()
.
That is, "because no value is return
ed from the function or .then()
", should be the Answer reproduced multiple times for exact same inquiry when the Question arises again?
What is the ultimate integrity of the duplicate procedure based on? Or is there no consistent integrity to the procedure and rules therefor?
Related: What is a canonical question/answer, and what is their purpose?