0

I have been doing the following:

if (json.RowKeyNew != "") {
    updateGridMeta(entity, json.PartitionKey, json.RowKeyNew, row, tab);
}

However if the json.RowKeyNew is null then the if condition is met which is not what I want. How can I check for something that is not null and not "" ?

3 Answers 3

3
if (json.RowKeyNew != undefined && json.RowKeyNew != "") {};
Sign up to request clarification or add additional context in comments.

Comments

0

Try...

if (json.RowKeyNew) {
    updateGridMeta(entity, json.PartitionKey, json.RowKeyNew, row, tab);
}

1 Comment

What if json.RowKeyNew is the number zero?
0
if (json.RowKeyNew) 

just put varible in if condition it return true if having some value else return false

Comments