How Promise does not return the promise object, but directly returns the value of resolve

functiong getPromise(){
    return Promise.resolve("something");
}

let getSomething = async function(){
       let a = await getPromise();
       return a;
}
 
The

async function returns a promise object, so there is no way to return a non-promise object.


async function getPromise(){
    return Promise.resolve('something');
}
let getSomething = async function(){
    let a = await getPromise();
    return a;
}
await getSomething()

clipboard.png

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-1e8a1cf-fb2.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-1e8a1cf-fb2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?