Jyve JS

Just like it says on the tin, this runs whatever JS your browser can currently support.

In [41]:
x = 1
Out[41]:
1
In [42]:
++x
Out[42]:
2
In [43]:
JSON.stringify(x)
Out[43]:
2

Modern browsers support:

- the class keyword for inheritance without prototype

`${string} templates` for concise string manipulation

In [44]:
class Adder {
    add(a, b) {
        document.write(
            `🐍 says <i>${a} plussss ${b} issss ${a + b}</i><br/>`
        )
        return a + b;
    }
}
this.Adder = Adder
Out[44]:
class Adder {
    add(a, b) {
        document.write(
            `🐍 says <i>${a} plussss ${b} issss ${a + b}</i><br/>`
        )
        return a + b;
    }
}
In [45]:
let it = new this.Adder();
it.add(1, 1)
Out[45]:
2
In [46]:
sir_not_appearing_in_this_notebook
Out[46]:
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)