{ "metadata": { "language_info": { "codemirror_mode": { "name": "javascript" }, "file_extension": ".js", "mimetype": "text/javascript", "name": "javascript", "nbconvert_exporter": "javascript", "pygments_lexer": "javascript", "version": "es2017" }, "kernelspec": { "name": "javascript", "display_name": "JavaScript", "language": "javascript" }, "toc-showcode": true }, "nbformat_minor": 4, "nbformat": 4, "cells": [ { "cell_type": "markdown", "source": "# JavaScript in `JupyterLite`\n\n![](https://jupyterlite.readthedocs.io/en/latest/_static/kernelspecs/javascript.svg)", "metadata": {} }, { "cell_type": "markdown", "source": "## Standard streams", "metadata": {} }, { "cell_type": "code", "source": "console.log('hello world')", "metadata": { "trusted": true }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": "console.error('error')", "metadata": { "trusted": true }, "execution_count": null, "outputs": [] }, { "cell_type": "markdown", "source": "## JavaScript specific constructs", "metadata": {} }, { "cell_type": "code", "source": "const delay = 2000;\n\nsetTimeout(() => {\n console.log('done');\n}, delay);", "metadata": { "trusted": true }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": "var str = \"hello world\"\nstr.split('').forEach(c => {\n console.log(c)\n})", "metadata": { "trusted": true }, "execution_count": null, "outputs": [] }, { "cell_type": "markdown", "source": "## Markdown cells", "metadata": {} }, { "cell_type": "markdown", "source": "Lorenz system of differential equations\n\n$$\n\\begin{aligned}\n\\dot{x} & = \\sigma(y-x) \\\\\n\\dot{y} & = \\rho x - y - xz \\\\\n\\dot{z} & = -\\beta z + xy\n\\end{aligned}\n$$\n", "metadata": {} } ] }