LestaD/nonstandard.js

View on GitHub
src/array/contains.js

Summary

Maintainability
A
0 mins
Test Coverage
const { CMI } = require('../tools');

module.exports = CMI(Array.prototype, 'contains', function(searchElements)
{
  if (!Array.isArray(searchElements)) {
    searchElements = [searchElements];
  }
  return searchElements.every(element => this.indexOf(element) > -1);
});