1. 程式人生 > >ejs裡面如何判斷某個引數是不是已經定義了?直接用會拋異常,直接判斷也會。

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.