var tmp = ['test', 'hoge', 'Hello', 'world'];
tmp.some(function(v){ return v === 'Hello' }) //-> true
tmp.some(function(v){ return v === 'hello' }) //-> false
some仕様
tmp.some(function(v, i, a){ console.log(v) })
->test
->hoge
->Hello
->world
tmp.some(function(v, i, a){ console.log(i) })
->0
->1
->2
->3
tmp.some(function(v, i, a){ console.log(a) })
->["test", "hoge", "Hello", "world"]
->["test", "hoge", "Hello", "world"]
->["test", "hoge", "Hello", "world"]
->["test", "hoge", "Hello", "world"]
二つの配列を比較
var a = ['test', 'hoge', 'hello', 'world'];
var b = ['aaa', 'bbb', 'ccc', 'hoge'];
a.some(function(v){ return b.some(function(vv){ return vv == v }) });
->true