Sobes.tech
Middle

If inside then return the value 1, the constant in which the result is recorded, will it be equal to 1 or something else?

sobes.tech AI

Answer from AI

If a promise's then method returns the value 1, then the next promise in the chain will receive this value.

Example:

const result = Promise.resolve(0)
  .then(() => 1);

result.then(value => console.log(value)); // Will output 1

Thus, the constant result is a promise that resolves to 1.

If inside then return the value 1, the constant in… - sobes.tech