May 23rd, 2018
November 20th, 2017
this works. Arrow functions look to 'fix' these confusions by implementing a lexical
this. Now the value of
this in an arrow function depends on what
this was equal to when arrow function was written (instead of when its called). This leads to confusing behavior if you are expecting arrow functions to act like normal function definitions. Let's look at an example.
November 15th, 2017
this from containing the global scope variable. What else does strict mode have to offer?
June 9th, 2018
November 11th, 2017
this I took shortcuts such as the popular
var self = this statement so I wouldn't worry about the value of
this in nested functions.
this so confusing is that it's set at runtime instead of author time (compile time)1. In other words it doesn't follow the rules of lexical scope that I am comfortable with.
this is incredibly daunting for new programmers since its value can be different when calling the same function on separate occasions.
November 13th, 2017
window, which represents the browser window. Window exposes an API for interaction with the Document Object Model (DOM), click listeners, and other information about the browser window1.
In the past I have used the
window object to check the current URL and previous page visited by the user (to create a 'back' button). However, the most common use of
window is to manipulate the DOM and set click listeners (I used frameworks such as JQuery to perform these tasks in the past).
November 8th, 2017
November 21st, 2017
XMLHttpRequest object (which is as poorly named as AJAX - it can be used for much more than XML!)1.
I made a custom google search API which was really easy and fun to create2! It searches certain websites for cat related posts (and is appropriately called meowmeow)! Who wouldn't love that? In my code I retrieve the article names from the top 10 searches in my custom meow search. The code uses the
XMLHttpRequest object and a callback function:
November 9th, 2017
This module provides lyrics for Taylor Swift songs (because who doesn't enjoy some T-Swift!) The
return statement is the public API for the module. All interior details, such as the
August 9th, 2018
There are two distinct pieces of GraphQL to remember. First its a language to create queries for an API. Second its a runtime library on the server to handle queries directed at the API. The GraphQL language is what I will look at first.
November 26th, 2017
By combining Promises and Generators, we can create a function that handles asynchronous tasks (let's call it
async). This function takes one parameter - a generator function. Each
yield statement in the generator returns a promise, which calls the generators iterator once resolved. Therefore each asynchronous task in the
async function moves on to the next task in sequential order. Let's look at some pseudocode:
June 13th, 2018
Introduction to Web Workers