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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more