9951 explained code solutions for 126 technologies


javascriptHow to check if array contains certain value


[1, 2, 3].includes(2)ctrl + c
[1, 2, 3]

test array to check value in

includes

this function checks if array has specified value

(2)

we're checking if our array has 2 in it