I have the following variable which has value of '-45'. I have the single quotes around the value to be able pass to a CAML query. Looks like the issue is related to that but don't know how to get around it (other than adding single quotes to my query itself).

var paramGetBy = "'-45'";

I am not able to check if the variable is undefined (when I comment the above line of code). I tried all the following ways.

if (!paramGetBy)
if (paramGetBy == null)
if (typeof(paramGetBy) == 'undefined')
if (typeof(paramGetBy) === 'undefined')

But, I am getting 'undefined' if I put the following alert when the variable is defined.