2.10.19 • Published 2 years ago

@extra-array/has-prefix.min v2.10.19

Weekly downloads
17
License
MIT
Repository
github
Last release
2 years ago

Checks if array starts with a prefix. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Similar: prefix, prefixes, hasPrefix. Similar: hasValue, hasPrefix, hasInfix, hasSuffix, hasSubsequence, hasPermutation, hasPath.

This is part of package extra-array.

This is browserified, minified version of @extra-array/has-prefix. It is exported as global variable array_hasPrefix. CDN: unpkg, jsDelivr.

array.hasPrefix(x, y, [fc], [fm]);
// x:  an array
// y:  prefix?
// fc: compare function (a, b)
// fm: map function (v, i, x)
const array = require("extra-array");

var x = [1, 2, 3, 4];
array.hasPrefix(x, [1, 2]);
// true

array.hasPrefix(x, [-1, -2]);
// false

array.hasPrefix(x, [-1, -2], (a, b) => Math.abs(a) - Math.abs(b));
// true

array.hasPrefix(x, [-1, -2], null, v => Math.abs(v));
// true

References

2.10.19

2 years ago

2.10.18

3 years ago

2.10.17

3 years ago

2.10.16

3 years ago

2.10.15

3 years ago

2.10.10

3 years ago

2.10.11

3 years ago

2.10.12

3 years ago

2.10.13

3 years ago

2.10.14

3 years ago

2.10.9

3 years ago

2.10.8

4 years ago

2.10.7

4 years ago

2.10.6

4 years ago

2.10.5

4 years ago

2.10.4

4 years ago

2.10.2

4 years ago

2.10.1

4 years ago