N
.includes() method is definitely my favorite way of checking if array contains a value, it makes code that much more readable. indexOf() is the "old way" of doing it because includes() is only supported in IE Edge 14+ (no IE11 support). But when targeting modern browsers, or a transpiler or node.js - includes() is the way to go. Fun fact - you can also use it on strings to check if string includes a value too: "Does foobar" .includes( "foo" ) // true