MCPcopy Create free account
hub / github.com/marijnh/Eloquent-JavaScript / out

Method out

src/client/sandbox.mjs:480–492  ·  view source on GitHub ↗
(type, args)

Source from the content-addressed store, hash-verified

478 }
479
480 out(type, args) {
481 let wrap = document.createElement("pre")
482 wrap.className = "sandbox-output-" + type
483 for (let i = 0; i < args.length; ++i) {
484 let arg = args[i]
485 if (i) wrap.appendChild(document.createTextNode(" "))
486 if (typeof arg == "string")
487 wrap.appendChild(document.createTextNode(arg))
488 else
489 wrap.appendChild(represent(arg, 58))
490 }
491 this.div.appendChild(wrap)
492 }
493}
494
495function span(type, text) {

Callers 4

setupEnvMethod · 0.45
outMethod · 0.45
errorMethod · 0.45
runCodeFunction · 0.45

Calls 1

representFunction · 0.70

Tested by

no test coverage detected