Espruino/tests/test_array_indexof.js
Michael Duerinckx 7f5308590b Rename numbered tests to something more descriptive - closes #16
test077 is the only one I really couldn't figure out what it was meant
to test.
2014-03-01 22:15:28 +00:00

15 lines
173 B
JavaScript

// Array.indexOf
var a = [8,9,10];
a["foo"]="lala";
a[3.333] = 3;
var r = [
a.indexOf(8),
a.indexOf(10),
a.indexOf(42)
];
result = r[0]==0 && r[1]==2 && r[2]==-1;