SolutionCottage.com
Posted  24 Feb 2009 - 12:52:28

Category: JavaScript


Check if variable is undefined

Issue:
You might want to check if a variable is "undefined", as in not set to anything, similar to null in C# and Nothing in VB.

Solution:
Use this method:

if(typeof(variable) != "undefined")



Marked as helpful by 2 users




0 comments:








© SolutionCottage 2008-2011 7/21/2017 3:36:54 AM