I have 3 variables which are dynamic and might be null or undefined.
Example:
var str1= " hello";
var str2= " world";
var str= " how are you?";
and now I'm concatenating these string together to form a query in my searchlist:
query = str1&& str1 + str2&& str2 + str3&& str3; //o/p: "hello world how are you?
this results fine, however in any case when one of the str value is null or empty, I get this whe I concatenate these string:
query = str1&& str1 + str2&& str2 + str3&& str3; // o/p: "hello world undefined"
How can I avoid this undefined coming in my string?