What's the difference between using reject and return reject in Promise's internal functions

can be run in Chrome. The program details are shown below:

clipboard.png

will the current task queue be rolled back to the status of the Project sibling as soon as you execute reject,?

Mar.19,2021

return reject has no special meaning. Promise makes Promise complete or failed through resolve and reject . Your return reject ('2') is executed reject ('2') and pops out.
if you return in advance, it will cause the Promise to be pending state.


return will jump out of the function, not return. If you have code after reject, it will be executed


here reject is a function. What is your function definition?


there is no difference, the same as the answer of the previous two bigwigs. Is to interrupt the execution of the current function. If there is no return, it will continue later, if there is no effect when rej/res is executed.

new Promise((res,rej)=>{
    res();
    console.log(1);
    rej();
    console.log(2)
})

Direct output: 1. And this is the resolve state.

Promise{<resolved>: undefined}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9c440-18c5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9c440-18c5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?