You can check if an array contains a value using the includes()
method.
Here’s an example:
const list = [1, 2, 3, 4]
list.includes(1) //true
list.includes(5) //false
Hey, make sure you join my 🥾 ⛺ BOOTCAMP waiting list, next cohort in March/April/May 2025
You can check if an array contains a value using the includes()
method.
Here’s an example:
const list = [1, 2, 3, 4]
list.includes(1) //true
list.includes(5) //false