ejs里面如何判断某个参数是不是已经定义了?直接用会抛异常,直接判断也会。

Express, EJS, challenge with testing for undefined

up vote
1
down vote
favorite
1
I’m creating a simple website with nodejs using the express framework, couchdb for a database and EJS for templating. There will be times when some of my fields are null or undefined in some of my JSON docs, and I need to handle that.

你可能感兴趣的:(前端,后端)