Skip to content

Instantly share code, notes, and snippets.

@masautt
Created September 6, 2019 18:26
Show Gist options
  • Save masautt/76ac3c8e7e12ca605c843467765041dd to your computer and use it in GitHub Desktop.
Save masautt/76ac3c8e7e12ca605c843467765041dd to your computer and use it in GitHub Desktop.
How to check if array contains a value in JavaScript?
console.log(["M", "A", "R", "E", "K"].includes("R")); // --> true
console.log(["M", "A", "R", "E", "K"].includes("S")); // --> false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment