Skip to content

Instantly share code, notes, and snippets.

@acidtone
acidtone / README.md
Last active April 14, 2024 12:36
Command Line Activity: Follow the white rabbit

Command Line Activity: Follow the white rabbit

This is a command line exercise for practicing basic file system navigation commands:

  • pwd: Display your present (working) directory
  • ls: List directory contents
  • cd: Change directory

Instructions

  1. Download this Gist to your workspace and expand/extract animal-world.zip.
  2. Navigate to this directory using your terminal.
  • Note: when you open a new terminal window (i.e. using Git Bash on Windows or Terminal on Mac OS) the default location will normally be your home folder (/Users/jane).
@acidtone
acidtone / README.md
Last active March 29, 2022 21:56
fetch: Asynchronous JS with async/await

fetch: Asynchronous data with async/await

Problem

When calling for data over the network in Javascript, the calling script won't wait for the data to come back. Instead, it continues to execute and any code that depends on the fetched data will return with an error.

Solution: async/await

ES6 added Promises which allows us to set "reminders" in our code that data is on its way.

ES7 added the async/await syntax that let's us use promises to "pause" our code for functions that are asynchronous.

fetch() using async/await