0.0.5 • Published 8 years ago
index-of-array-sequence v0.0.5
Index Of Array Sequence
Find index of array sequence
Install
$ npm install --save index-of-array-sequence
Usage
Find the index of an array sequence
var indexOfArraySequence = require("index-of-array-sequence")
quote = ["hello","world"]
source = ["This", "is", "a", "hello", "world", "program"]
indexOfArraySequence(quote, source)
//=> 3
Test
$ mocaha test.js
API
indexOfArraySequence(searchSequence, source)
Returns the position of the first occurrence of a specified sequence in an array. Method returns -1 if the value to search for never occurs.
Name | Type | Description |
---|---|---|
searchSequence | Array | An array or string that represent the sequence you'll be searching for |
source | Array | The array or string to be searched |
var indexOfArraySequence = require("index-of-array-sequence")
quote = ["hello","world"]
source = ["This", "is", "a", "hello", "world", "program"]
indexOfArraySequence(quote, source)
//=> 3
indexOfArraySequence(quote, source)
//=> 3