aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <holden.rohrer@gmail.com>2019-12-27 00:04:11 -0500
committerHolden Rohrer <holden.rohrer@gmail.com>2019-12-27 14:57:57 -0500
commitde7d95b13af448ad2c7547060de8ce08fcedd3e4 (patch)
tree7bb83e871559db81cd08b8e248bca7173cafe248
parentba62050f97564e49d8e4091a0b3360bbbd8650a2 (diff)
fixed space.print() modifying internal data
-rw-r--r--space.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/space.js b/space.js
index 3fc14f4..86bd067 100644
--- a/space.js
+++ b/space.js
@@ -64,7 +64,7 @@ function Space(){
};
this.print = function(){
- return this.data.map(row => replace(replace(replace(row,'&','\\&'),'\\','\\\\'),'','&').join('')).join('\n');
+ return this.data.map(row => replace(replace(replace(row.slice(),'&','\\&'),'\\','\\\\'),'','&').join('')).join('\n');
}
this.fromfile = function(filename){ //Reads an external file into internal data