Espruino/tests/test_array_and_object_in_condition_check.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

16 lines
228 B
JavaScript

// test IF IN syntax
var a = [0,1,2,3];
var b = ["A","B","C"];
var c = { hello : "there" };
var z =
(1 in a)?0:1 +
(4 in a)?2:0 +
("C" in b)?0:4 +
("D" in b)?8:0 +
("hello" in c)?16:0 +
("there" in c)?0:32;
result = z==0;