In js empty string is considered as falsy value.
let str = \'\'; if (str) { alert(\'success\') } else { alert(\'failure\') }
i get printed