Logo

Programming-Idioms

History of Idiom 12 > diff from v51 to v52

Edit summary for version 52 by mmx:
New JS implementation by user [mmx]

Version 51

2016-11-30, 21:11:42

Version 52

2017-04-19, 04:57:30

Idiom #12 Check if list contains a value

Check if list contains a value x.
list is an iterable finite container.

Illustration

Idiom #12 Check if list contains a value

Check if list contains a value x.
list is an iterable finite container.

Illustration
Extra Keywords
array vector
Extra Keywords
array vector
Code
list.includes(x)
Comments bubble
ES7 (Works on strings from ES6)
Doc URL
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes