I tried two function in(async function,normal function)in node js.normal function its sucessfully return value.but async function its cant return value.How to fix it
normal function
index.js
var sample_data = require('./product')
const data = sample_data
console.log(data)
product.js
function sample()
{
console.log("hai")
return "hello"
}
module.exports = sample
async function
index.js
var sample_data = require('./product')
const data = sample_data
console.log(data)
product.js
async function sample()
{
console.log("hai")
return "hello"
}
module.exports = sample
normal function
Expected output
hai
hello
async function
Expected ouput
hai
hello
but I got output
[AsyncFunction: sample]