I want to store and print a variable (string in this case) sent from ejs by console.log in script tag
but it gives me an "(index):19 Uncaught ReferenceError: Cannot access 'text' before initialization"
code in node js
app.get("/", (req, res)=> {
res.render("index", {message: "hello world"})
})
code in html
<script>
const text = <% message %>
console.log("message is " + text);
</script>