javascript - how to check if a parameter is present in the querystring in node.js -
how validate if parameter exits in querystring or not in node.js ?
i validating this
if(prm1 == null) return error
but in console.log(prm1) says undefined..
how validate ?
if parameter not present in querystring returned undefined
. parameter wouldn't return null
because wasn't initialised.
try :
if(typeof prm1 != 'undefined') return "error";
Comments
Post a Comment