Public
Edited
May 18, 2024
Paused
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
globalEval("this")
Insert cell
Insert cell
globalEval(/* indirect call */ "this") === eval(/* direct call */ "this") // expected output: false
Insert cell
Insert cell
((x, y) => globalEval("x + y")).apply(null, [2, 2]) // expected output: ReferenceError
Insert cell
((x, y) => eval("x + y")).apply(null, [2, 2])
Insert cell
Insert cell
globalEval("with (Math) PI")
Insert cell
globalEval("'use strict'; with (Math) PI") // expected output: SyntaxError
Insert cell
eval("with (Math) PI") // expected output: SyntaxError
Insert cell
Insert cell
globalEval = function () {}.constructor.call(null, script)
Insert cell
Insert cell
options = [
/* thank you, Juriy "kangax" Zaytsev! - mg */
"eval.call",
"eval('eval')",
"[eval][0]",
"(1, eval)",
"(1 ? eval : 0)",
"($$ = eval)",
"(($_) => $_)(eval)",
"eval?."
]
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more