I've got a json encoded dataset that I retrieve via ajax. Some of the data points I'm trying to retrieve will come back us null or empty.
However, I don't want those null or empty to be displayed to the end user, or passed on to other functions.
What I'm doing now is checking for
if(this.cityState!='null'){
// do some stuff here
}
However, for each line I find myself going through multiple if statements, and it seems very inefficient. Is there a better way to do this?