Javascript - Array - How to check if array contains all objects with specific property

preview_player
Показать описание
Javascript tutorial. This is example how to check if array contains at least one object with an attribute that equals a given value
Javascript
0:00 Use case
1:27 Trying to learn piano

Рекомендации по теме
Комментарии
Автор

Hi Alex.
Do you know how I can use the “IN” operator, similar SQL but with java?

For example:

I usually create a lot of Else If, for the same results.
But, if want to create only one Else IF using de IN operator (similar to SQL)

Imagine that I have a lot of Else if (10). One for each results
B

if (left(column("StringColumn"), 2) == "OE")
{
"ComConfronto_Msaf"
}
else if (left(column("StringColumn"), 2) == "EU")
{
"ComConfronto_Msaf"
}


But the code is to long and I want to simplify, similar to this:
if (left(column("StringColumn"), 2) == IN("OE", "EU", ETC, ETC, ETC)

I think that in java, I will have to use an array.
How could it be?

felipesignorellireis