3
well I want to know if my comparison has how to be improved, I want to make the code shorter (dry)
const teste = function(a){
if(a != null && a != undefined && a != ""){
console.log('e diferente')
}else{
console.log(`o valor que vc passou e ${a}`)
}
}
teste()
About the part if(a != null && a != undefined && a != "")
, how can I make it shorter?
the code could become even more readable, because an Arrow function with only one parameter does not need to ( ), would be... const test = a => a ?...
– Natan Teodoro
Yes, but considering your question: the part if(a != null && a != Undefined && a != "") how can I make it shorter ? ... That wasn’t the focus when answering.
– NoobSaibot
Arrow funtion are not compatible with a pair browsers
– Sveen