var checkActiveBrand = $(".brand__title").attr("data-brand-title");
I have this variable to get my data .brand__title, but I also want to check if it was empty or not, but I do not want to use ifto check it.
if(!checkActiveBrand){
checkActiveBrand = null;
}
I do not want to use this, I want one line to set everything, and if not, return nullwithout using the operator if. Is there any way? because I have a lot of data to check, it will be random if I installed and checked everything one by one.
source
share