1if(typeof comment === 'undefined') {
2
3 alert('Variable "comment" is undefined.');
4
5} else if(comment === null){
6
7 alert('Variable "comment" is null.');
8
9}
1let id;
2
3if(typeof id === 'undefined') {
4 console.log("id is undefined...");
5}
1var x; //variable to change
2var y; //higher priority variable
3var z = 12; //lower priority variable
4x = !(y === undefined) ? y : z;
5console.log(x); //12