@extra-array/includes-only
v1.1.7
Published
Check if only value is present in array.
Downloads
77
Maintainers
Readme
Check if only value is present in array.
const includesOnly = require('@extra-array/includes-only');
// includesOnly(<array>, <value>, [begin=0], [end])
// -> true|false
includesOnly(['a', 'b', 'b', 'c'], 'b');
// false (abbc !== bbbb)
includesOnly(['a', 'b', 'b', 'c'], 'b', 1);
// false (bbc !== bbb)
includesOnly(['a', 'b', 'b', 'c'], 'b', 1, 3);
// true (bb === bb)
With extra-array try
Array.includesOnly()
instead.