From de7d95b13af448ad2c7547060de8ce08fcedd3e4 Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Fri, 27 Dec 2019 00:04:11 -0500 Subject: fixed space.print() modifying internal data --- space.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit