index-of-array-sequence

0.0.5 • Public • Published

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

/index-of-array-sequence/

    Package Sidebar

    Install

    npm i index-of-array-sequence

    Weekly Downloads

    7

    Version

    0.0.5

    License

    MIT

    Last publish

    Collaborators

    • joegesualdo