Skip to main content
eLearner.app
JS CODE CRACKER

JS Code Cracker

Find the security vulnerability and run an exploit in an isolated JavaScript sandbox.

Security Level 1

The first security system requires generating a protected key via private scope. Implement the 'createSecureCounter' function which returns another function. This inner function must increment a private counter variable on each invocation and return the current count. When the counter reaches exactly 42, it must return the unlock string 'JS-SECRET-KEY'.

Sandbox Status

LOCK 1
LOCK 2
LOCK 3
Complete each level to perform the final sandbox exploit.

Stuck?

Learn the fundamental concepts in the JavaScript course to solve this challenge.

JavaScript Sandbox Console

Write and execute JavaScript code locally in your browser.

Loading editor…
Loading JS isolated execution environment...