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

14 lines
273 B
JavaScript

// test for defining and executing a function
/*function foo(x) {
var arr = ["zero","one","two","three"];
return arr[x];
}*/
var foo = function() {
var arr = ["zero","one","two","three"];
return function (x) { return arr[x]; }
}();
result = foo(1)=="one";