jeudi 24 décembre 2020

how to use if var is or it in javascript [duplicate]

my code is like

if (arrayB !== '\n' || ''){
//function
}

maybe you understand, i not learn english like pro yet and not know how to describe it. But i want to exclude a blank character or newline character if code like above it work for newline only but if i write lik this

if (arrayB !== '' || '\n'){
//function
}

it work for blank but not for newline character, i try use && it's same. How to code right?

Aucun commentaire:

Enregistrer un commentaire