I'm having a problem about calling a function in ejs file.
I have the separated js file 'main.js' which is
// this is main.js
var hello = function() {
return "hello";
}
I want to call hello() in my ejs file but it returns an error.
hello is not defined
This is my ejs file
<script src="path/main.js"></script>
<%= hello() %> ***this is where the error occurs.
If anyone knows how to fix this please tell me. I appreciate all your helps. :)