0.0.5 • Published 8 years ago

index-of-array-sequence v0.0.5

Weekly downloads
2
License
MIT
Repository
-
Last release
8 years ago

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.

NameTypeDescription
searchSequenceArrayAn array or string that represent the sequence you'll be searching for
sourceArrayThe 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