MCPcopy Create free account
hub / github.com/nwutils/nw-sample-apps / arrayContains

Function arrayContains

mini-code-edit/cm/lib/util/javascript-hint.js:6–17  ·  view source on GitHub ↗
(arr, item)

Source from the content-addressed store, hash-verified

4 }
5
6 function arrayContains(arr, item) {
7 if (!Array.prototype.indexOf) {
8 var i = arr.length;
9 while (i--) {
10 if (arr[i] === item) {
11 return true;
12 }
13 }
14 return false;
15 }
16 return arr.indexOf(item) != -1;
17 }
18
19 function scriptHint(editor, keywords, getToken) {
20 // Find the token at the cursor

Callers 1

maybeAddFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected