Tagged “javascript”

  1. In praise of the switch statement

    A tutorial on how to use an underused tool in Javascript - the switch statement.

  2. How to mock fetch requests in React Testing Librarty tests

    Creating a mock server with msw to make React Testing Librarty tests for your components.

  3. A Lightweight Way to Read GraphQL Data

    I share a lightweight function that will let you read a GraphQL endpoint without the need for heavy libraries. This is great for simpler use cases.

  4. How to make a color changing favicon

    Learn how to create a dynamic favicon with color-changing capabilities using JavaScript. This article goes line by line explaining how to do it. Additionally, discover how to update Safari's color scheme in real-time using the theme-color meta tag.

  5. A Javascript Component Pattern

    A walk through the typical JavaScript pattern that we use at my work.

  6. Javascript Fallback Values on Variables and Booleans - a hard lesson

    A lesson I learned using fallback values on a JavaScript variable, but ran into trouble when it dealt with a boolean.

  7. JavaScript events: .target vs .currentTarget