|
@@ -72,7 +72,7 @@ The `CodeBox` class constructor's third parameter is an optional object of optio
|
|
|
In the following example, we create an `OutputLogger` object that stores the output from the Code Box. Then, after the Code Box has run, we can output all of the values as one whole string. If we were to just use the initial value of `console.log` as the output function, we would get each character on a new line.
|
|
|
|
|
|
```Javascript
|
|
|
-class OutputJoiner {
|
|
|
+class OutputLogger {
|
|
|
constructor(joinChar = "") {
|
|
|
this.out = "";
|
|
|
this.JOIN_CHAR = joinChar;
|
|
@@ -88,7 +88,7 @@ class OutputJoiner {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const output = new OutputJoiner();
|
|
|
+const output = new OutputLogger();
|
|
|
const cb = new CodeBox(`"Hello, World!"r>Ool?u!|;`, [], {
|
|
|
outputCallback: output.push.bind(output),
|
|
|
});
|