Convert and compare strings
Strictly comparing objects is false because no two objects are the same. You could convert each array within the array to a string using join() and split(). Then use indexOf to instead find "0,1".
[0,1] === [0,1] // false
"0,1" === "0,1" // true
The goal: ["0,1","1,1","1,2"].indexOf("0,1") which is the intended use of indexOf()
var needle = [0,1].join(); // or "0,1"
var haystack = [ [0,1],[1,1],[1,2] ];
var index = haystack.join('-').split('-').indexOf(needle);
document.getElementById("demo").innerHTML = index ;
<p id="demo"></p>
.join('-') produces "0,1-1,1-1,2"
.split('-') produces ["0,1", "1,1", "1,2"]
.indexOf("0,1") produces 0
Standalone Function
var needle = [0,1];
var haystack = [["0,1"],["1,1"],["1,2"]];
var index = getIndex(needle, haystack) // returns 0
function getIndex(needle, haystack) {
return haystack.join('-').split('-').indexOf( needle.join() );
}