I rendered view with one variable and want to use the variable in javascript file included rendered view. I use pug view template
**Server Side.**
res.render('myView', { myval:'pizza'});
**Client Side**
extends ../layout
block content
script(src="scripts/myscript.js")
**myscript.js**
$(function(){
alert(myval);
});
or
**index.pug**
script(type='text/javascript').
var val= '#{myval}';
alert(val);
how to do it? looking forward any help.