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

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -