What I essantily want to do is compare all values in array to 123 in an if statment
let values = [1, 2, 3, 123]
if (123 == values.forEach(e => {return e})){
currently, I’m getting an error:
values.forEach(e => {return e})) is not a function
>Solution :
If i understand that you want, try something like this
let values = [1, 2, 3, 123]
if (values.includes(123)) {
*do some code*
}