jest var nie jest pusta, a następnie wyświetl wartość w JavaScript

if(data !== null && data !== '') {
   // do something
}
Mr. Samy