add playground pretzel maps

This commit is contained in:
Sebastian McKenzie
2014-11-26 16:17:27 +11:00
parent f1a2401681
commit be0d4b344b
10 changed files with 83 additions and 4 deletions

View File

@@ -0,0 +1,7 @@
["foo", "bar"].map(:toUpperCase);
[1.1234, 23.53245, 3].map(:toFixed(2));
var get = function () {
return 2;
};
[1.1234, 23.53245, 3].map(:toFixed(get()));

View File

@@ -0,0 +1,7 @@
assert.deepEqual(["foo", "bar"].map(:toUpperCase), ["FOO", "BAR"]);
assert.deepEqual([1.1234, 23.53245, 3].map(:toFixed(2)), ["1.12", "23.53", "3.00"]);
var get = function () {
return 2;
}
assert.deepEqual([1.1234, 23.53245, 3].map(:toFixed(get())), ["1.12", "23.53", "3.00"]);

View File

@@ -0,0 +1,16 @@
"use strict";
var _args;
["foo", "bar"].map(function (_val) {
return _val.toUpperCase();
});
[1.1234, 23.53245, 3].map(function (_val2) {
return _val2.toFixed(2);
});
var get = function () {
return 2;
};
[1.1234, 23.53245, 3].map((_args = [get()], function (_val3) {
return _val3.toFixed(_args[0]);
}));