JSPM

in_array

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 338
  • Score
    100M100P100Q104734F
  • License MIT

The Javascript version of "in_array" php function from the php.js project - http://phpjs.org/

Package Exports

  • in_array

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (in_array) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

in_array

This is the Javascript implementation of the in_array php function. The function is originally made by the php.js organization and its contributors.

Instalation

With npm:

npm install --save in_array

With Bower:

bower install --save in_array

Or you can just download a ZIP.

Setup

Node or Browserify
var in_array = require('in_array');
Browser (Global)
<script src="in_array.js"></script>

Usage

in_array(item, arrayOrObject, useStrictMode);

console.log(in_array(1, ['1', '2', '3'])); // Returns: true
console.log(in_array(1, ['1', '2', '3'], true)); // Returns 'false' because the strict mode is on.
console.log(in_array(1, {key: 1})); // Returns: true

License

MIT