a2z wk2 class notes

New way of loading data (jsons) to avoid callback hell:


async await for sequential execution, avoids promise hell

() => replacement for anonymous function

=> for one line of code

button.mousePressed(() => background(255,0,0));

loadJSON('data.json', data => console.log(data));

for…of loop:

for(let word of words) {
let span =
  span.mouseOver(() => span.style("background-color", "red"));



  • All words: \w
  • Match beginning of the line: ^
  • Match first word of a line: ^\w+
Posted in A2Z

Leave a Reply

Your email address will not be published. Required fields are marked *