Difference between revisions of "JavaScript/Higher-order programming/Print.js"
From Spherical
(created) |
(syntax highlight) |
||
Line 1: | Line 1: | ||
+ | <syntaxhighlight> | ||
var Print = function () { | var Print = function () { | ||
var fullString = ""; | var fullString = ""; | ||
Line 27: | Line 28: | ||
}; | }; | ||
}(); | }(); | ||
+ | </syntaxhighlight> |
Revision as of 00:37, 15 June 2013
var Print = function () {
var fullString = "";
function clear() {
fullString = "";
}
function print(value) {
fullString += value.toString();
}
function printLine(value) {
if (value)
print(value);
print("\n");
}
function display() {
Abort(fullString + "\n");
}
return {
clear: clear,
print: print,
printLine: printLine,
display: display
};
}();