Js how to get the return value of asynchronous function callback.

  node.js, question
function getTBS(){
 console.log(data);  //how to use data as the return value of getTBS?
 getTBS();  //{"tbs":"a2bdd05a3fd08e561463670847","is_login":1}

Baidu has been using callback function for a long time, but I still don’t know much about it. Can you give me an example to ask for advice? .

Data has not been received after your getTBS function returns, so return is not possible.
It should be helpful for you to know about promise object and async/await keyword.