# 存在チェック(Exists, In, Contains)

# C++

(find(items.begin(), items.end(), v) != items.end())
#include <algorithm>
(find(items.begin(), items.end(), v) != items.end())

# JavaScript

items.includes(v)
var arr = ['a', 'b', 'c', 5]

arr.includes('b'); // => true
arr.includes(5);   // => true
arr.includes('e'); // => false

# PHP

in_array($v, $items, $strict = true)
in_array($v, $items, true)

# PowerShell

$items -contains $v

Python 風に、こうでもいい

$v -in $items

# Python

v in items
'a' in ['a', 'b', 'c']

# Ruby

items.include?(v)
['a', 'b', 'c'].include?('a')

# Swift

items.contains(v)

[ 📩 ご意見 ]