Javascript

1. Javascript   js

properties


ID: d9226de2-4b80-4193-a06e-e3185ffb5217
CREATED:


edges

<- org-info.js
<- parenscript
<- jscl


I don't have much direct use for javascript, but given its popularity and status as the de-facto web language it is necessary learning for all students of the internet.

  • on javascript versions
    • JS has been around since the 90s where it was introduce with a typical versioning scheme starting at 1.0. Some transpilers such as parenscript reference this versioning scheme (*js-target-version* is "1.3")

      The most significant change in JavaScript 1.3 was compliance with ECMA-262 and Unicode by removing inconsistencies between JavaScript 1.2 and the new ECMA standard (which was published in June 1997). Additional features of version 1.2, at the time not specified by ECMA-262 were kept in the JavaScript language

    • ECMA took over in the late 90s and it became ES1-ES6, but now it seems there is a yearly cadence and they should use a simple integer??
    • ES5 seems to be the minimum for web browsers - 2009 version
    • ES6 is generally supported by all versions - 2015 version
    • AFTER 2015, went to a yearly release cadence (JS 2016 - JS 2025)
    • as of 2025 we are on the 16th Edition of ECMAScript
  • ECMAScript® 2026 Language Specification (latest draft)
  • tc39/test262: Official ECMAScript Conformance Test Suite
  • version detection is a waste of time in JS

    function supports_canvas() {
      return !!document.createElement("canvas").getContext;
    }
    
    if (supports_canvas()) {
      // Create and draw on canvas elements
    }
    

    The double NOT in the above example (!!) is a way to force a return value to become a "proper" boolean value, rather than a Truthy/Falsy value that may skew the results.

    if (window.matchMedia("(width <= 480px)").matches) {
      // run JavaScript in here.
    }
    
    if (typeof fetch === "function") {
      fetch("/data.json")
        .then(res => res.json())
        .then(data => {
          console.log("Fetched data:", data);
        });
    }
    
    // check for web share API
    if (typeof navigator.share === "function") {
      navigator.share({
        title: "Web Feature Example",
        text: "This device supports sharing",
        url: window.location.href
      });
    }
    
    // using the ?. operator
    const penSupported =
      (navigator?.maxTouchPoints ?? 0) > 0 &&
      ("PointerEvent" in window);
    if (penSupported) {
      console.log("Device supports pointer input.");
    }
    
    // check color-scheme
    const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
    if (prefersDark) {
      document.documentElement.classList.add("dark-theme");
    }
    
    // check hover input
    const hasHover = window.matchMedia("(hover: hover)").matches;
    if (hasHover) {
      document.body.classList.add("hover-supported");
    }
    

1.1. Runtimes

properties


ID: f591261a-576f-4e4f-87c3-e19833b85eac
CREATED:


JS is a broad ecosystem with several runtimes, usually (but not always) associated with major web browsers.

1.1.1. Deno

properties


ID: ce8b2093-0cd1-4d6f-b174-ba4c20124bb4
CREATED:


edges

Deno, the next-generation JavaScript runtime


1.1.2. Node.js

properties


ID: 1252c186-c72a-4a0e-b2d9-b325b826cea5
CREATED:


edges

Node.js - Run JavaScript Everywhere


1.1.3. SpiderMonkey

properties


ID: 66853806-45a7-4e01-be31-29c6f76d8f6d
CREATED:


  • used in Mozilla Firefox

1.1.4. V8

properties


ID: ba734e40-8fff-43b1-a68d-3d7a1c2afe8d
CREATED:


  • used in Google Chrome

1.1.5. JavaScriptCore

properties


ID: 302ab51f-539e-400e-8f59-124f1cb89676
CREATED:


  • used in Apple Safari

1.2. Libraries

properties


ID: 7ddd2d60-6a99-4948-aa7b-f36dc9839599
CREATED:


1.2.1. Minisearch

properties


ID: fe82f0c8-b506-46b6-8384-d9439baad99c
CREATED:


edges

– [BROKEN LINK: github:lucaong/minisearch]
MiniSearch


1.2.2. Folk.js

properties


ID: 54f1f814-5b88-4f46-83aa-cd26841b1dfa
CREATED:


edges

folkjs
– [BROKEN LINK: github:folk-js/folkjs]


1.2.3. 3d-force-graph

properties


ID: ff42d3aa-94cf-4f88-8fe7-9f54fcaf95f6
CREATED:


edges

– [BROKEN LINK: github:vasturiano/3d-force-graph]


1.2.4. WebCola

properties


ID: 1dd1ff5b-c2bb-47ff-96d0-f56d2fac465b
CREATED:


edges

tgdwyer/WebCola: Javascript constraint-based graph layout
cola.js: Constraint-based Layout in the Browser


1.2.5. Cytoscape.js

properties


ID: 5886ca2e-a096-4f08-b08e-75da2c12109a
CREATED:


edges

Cytoscape.js


1.2.6. Chart.js

properties


ID: 9be0cef1-830d-4d76-970e-f786cd60d48f
CREATED:


edges

Chart.js | Open source HTML5 Charts for your website


1.2.7. SVG.js

properties


ID: b2f13ede-db9d-494b-a454-515496cb6b7e
CREATED:


edges

SVG.js v3.2 | Home


1.2.8. d3.js

  1. d3-force-3d
    properties


    ID: 3f02fc98-932e-41da-a810-2b8c4b31083f
    CREATED:


    edges

    – [BROKEN LINK: github:vasturiano/d3-force-3d]
    Multi-Dimensional D3 Force Simulation / Vasco Asturiano | Observable


1.2.9. Three.js

properties


ID: e0c38219-7b90-4981-a46f-d3fe92888996
CREATED:


edges

GitHub - mrdoob/three.js: JavaScript 3D Library.


1.2.10. React

properties


ID: 05a83166-2afc-41b2-8b64-9fcb2a33a5d8
CREATED:


edges

React


  1. Next.js
    properties


    ID: ccbf8bb8-4195-4e6a-8a72-87a7fed916b1
    CREATED:


    edges

    Next.js by Vercel - The React Framework


1.2.11. Feature.js

properties


ID: fdf7f4ee-049d-4050-ac28-501726b0e2a5
CREATED:


edges

Feature.js


1.2.12. Modernizr

properties


ID: 53ba1f16-8e99-427f-8456-fce832f57e1c
CREATED:


edges

Modernizr: the feature detection library for HTML5/CSS3


1.3. Utils

properties


ID: 103a7228-964b-4075-98e1-1e3ca730dc52
CREATED:


1.3.1. Uglify

properties


ID: f2570e7e-b15d-4e75-9ae9-a12e581cb510
CREATED:


edges

UglifyJS — JavaScript parser, compressor, minifier written in JS


1.3.2. Minify

properties


ID: 161d575a-30e7-466c-bff8-df5d05b21d8a
CREATED:


edges

How to Minify JavaScript — Recommended Tools and Methods


1.4. TypeScript   ts

properties


ID: 58d76125-7110-4c76-b8d4-7014d407cc1d
CREATED:


edges

TypeScript: JavaScript With Syntax For Types.