2.10.19 • Published 3 years ago

@extra-array/search-subsequence.min v2.10.19

Weekly downloads
43
License
MIT
Repository
github
Last release
3 years ago

Finds first index of a subsequence. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Similar: subsequence, subsequences, hasSubsequence, searchSubsequence. Similar: hasValue, hasPrefix, hasInfix, hasSuffix, hasSubsequence, hasPermutation.

This is part of package extra-array.

This is browserified, minified version of @extra-array/search-subsequence. It is exported as global variable array_searchSubsequence. CDN: unpkg, jsDelivr.

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

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

array.searchSubsequence(x, [-2, -4]);
// -1

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

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

References

2.10.19

3 years ago

2.10.18

4 years ago

2.10.17

4 years ago

2.10.15

4 years ago

2.10.16

4 years ago

2.10.10

4 years ago

2.10.11

4 years ago

2.10.12

4 years ago

2.10.13

4 years ago

2.10.14

4 years ago

2.10.9

4 years ago

2.10.8

4 years ago

2.10.7

4 years ago

2.9.64

4 years ago

2.10.1

4 years ago

2.10.2

4 years ago

2.10.0

4 years ago

2.10.5

4 years ago

2.10.6

4 years ago

2.10.4

4 years ago

2.9.63

4 years ago

2.9.60

4 years ago

2.9.61

4 years ago

2.9.62

4 years ago

2.9.59

4 years ago

2.9.58

4 years ago

2.9.57

4 years ago

2.9.56

4 years ago

2.9.55

4 years ago

2.9.52

4 years ago

2.9.53

4 years ago

2.9.54

4 years ago

2.9.51

4 years ago

2.9.50

4 years ago

2.9.49

4 years ago

2.9.48

4 years ago

2.9.45

4 years ago

2.9.46

4 years ago

2.9.47

4 years ago

2.9.44

4 years ago

2.9.43

4 years ago

2.9.42

4 years ago