Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created September 20, 2015 14:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save chuck0523/14ee0f2622373472ca22 to your computer and use it in GitHub Desktop.
"use strict";
var log = function log(x) {
console.log(x);
};
var ary = [10, 23, 4, 0, 77];
var a = ary.indexOf(10);
log(a); // 0
var b = ary.indexOf();
log(b); // -1
var c = ary.indexOf('0');
log(c); // -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment