Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
(function () {
  function contains (array, value) {
    var doesContain = false
    for (var i = 0, length = array.length; i < length; i++) {
      if (array[i] === value) {
        doesContain = true
        break
      }
    }
    return doesContain
  }
  
  var nums = [1, 2, 3, 4, 5]
  
  console.log(nums)
  console.log(contains(nums, 3))
  console.log(contains(nums, 0))
  console.log(contains(nums, 4.2))
})()
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers