Closed AngeloCore closed 1 year ago
This will actually work, if your function getSomething
is defined in the global context (and before you attempt to execute), and you put the function reference inside the JS block: <% let test = getSomething(); %>
.
The key here is understanding that all EJS does is build a string of executable JavaScript that it then runs in the global context, when you render the template. That's it.
For example: