I want to display object value that i save in variable. How it works in NodeJS?
Here's my code:
const modelMateris = require("../models/materi");
var obj = modelMateris.find().exec((err, result)=>{
if(result){
return (result);
} else (err);
})
console.log(obj);
I got undefined output. So how to print it in NodeJS? Thanks.