Thursday, 15 August 2013

javascript - js conditional: if not false, null or undefined then -



javascript - js conditional: if not false, null or undefined then -

i have !! markup anther object , works, here doesn't (in 1 case, works in other cases).

if (!!slides) { console.log("close view clear slides") clearinterval(slides); }

in firebug error:

referenceerror: slides not defined

what should conditional be?

you can't utilize variable if it's not defined.

typeof(asdf) "undefined" !asdf referenceerror: asdf not defined if (typeof(asdf) != "undefined") { // execute if asfd defined. }

javascript if-statement

No comments:

Post a Comment