I\'ve come across the following code:
function test(data) { if (data != null && data !== undefined) { // some code here } } >
function test(data) { if (data != null && data !== undefined) { // some code here } }
The simple way to do your test is :
function (data) { if (data) { // check if null, undefined, empty ... // some code here } }