Application Construction

We’ll usually put our “application code” in a file named main.js

'use strict;'

let canvas = undefined;  // Our HTML <canvas> element
let gl = undefined;      // Our WebGL context

function init() {
   ...
}

function render() {
    ...
}

// Start our application when the HTML page loads
window.onload = init();