Another way to test for a property is to reference it indirectly via the locals object. Using your example:
var tpl="<% if(locals.foo){ %>foo defined<% }else{ %>foo undefined<% } %>";
console.log(ejs.render(tpl, { locals: { bar: "baz"} }));
Another way to test for a property is to reference it indirectly via the locals object. Using your example:
var tpl="<% if(locals.foo){ %>foo defined<% }else{ %>foo undefined<% } %>";
console.log(ejs.render(tpl, { locals: { bar: "baz"} }));