I’m doing some quizes on Typescript and I stumble on this quiz. All of the correct answers are doing something like this:
if (this.score_ & ALLERGENS_SCORE[allergen]) {
return true
}
Both of the this.score_
and ALLERGENS_SCORE[allergen]
are number. I’m wondring what the single &
do here.
I understand what it is for for types, but not on this scenario.
Here are some correct answer for this: this and this
I’d appreciate if someone can explain. Thanks in advance.
1