Just like it says on the tin, this runs whatever JS your browser can currently support.
x = 1
1
++x
2
JSON.stringify(x)
2
Modern browsers support:
class
keyword for inheritance without prototype
`${string} templates`
``` for concise string manipulation
- [`async/await` keywords](https://caniuse.com/#feat=async-functions) for asynchronous code (inside functions)
- and more!
class Adder {
add(a, b) {
document.write(
`🐍 says <i>${a} plussss ${b} issss ${a + b}</i><br/>`
)
return a + b;
}
}
this.Adder = Adder
class Adder { add(a, b) { document.write( `🐍 says <i>${a} plussss ${b} issss ${a + b}</i><br/>` ) return a + b; } }
let it = new this.Adder();
it.add(1, 1)
2
sir_not_appearing_in_this_notebook
ReferenceError: sir_not_appearing_in_this_notebook is not defined
ReferenceError: sir_not_appearing_in_this_notebook is not defined at eval (eval at <anonymous> (http://localhost:8888/lab/static/main.74357be9c7455b0cd0fb.js:157212:53), <anonymous>:1:1) at eval (<anonymous>) at Object.<anonymous> (http://localhost:8888/lab/static/main.74357be9c7455b0cd0fb.js:157212:53) at http://localhost:8888/lab/static/main.74357be9c7455b0cd0fb.js:157213:36 at new Promise (<anonymous>) at JSUnsafeKernel.<anonymous> (http://localhost:8888/lab/static/main.74357be9c7455b0cd0fb.js:157205:47) at step (http://localhost:8888/lab/static/main.74357be9c7455b0cd0fb.js:83284:23) at Object.next (http://localhost:8888/lab/static/main.74357be9c7455b0cd0fb.js:83265:53) at fulfilled (http://localhost:8888/lab/static/main.74357be9c7455b0cd0fb.js:83255:58)