Marcus

Marcus is a fullstack JS developer. He’s passionate about the hapi framework for Node.js and loves to build web apps and APIs. Creator of Futureflix and the “learn hapi” learning path.


JavaScript — Cache Computation Results in a Local Variable

We’re using a small performance optimization in our code bases: caching computation results in local variables. Saving results in a local variable is borrowed from the memoization technique. Memoizing values improves the performance of function execution by storing the results and reusing them for a function call. This tutorial …

Continue Reading

fetch — Detect Network Error

We’re building a Vue.js application for a client project. This Vue.js app uses the useFetch composable from VueUse. This composable uses the browser’s fetch to send requests to a given URL and handle the responses. We wanted to integrate handling in the Vue.js app to …

Continue Reading

MySQL — Add Days to a Datetime

MySQL supports dates and date times as column types. It’s a nice way to keep track of when things happen or should happen. Working with dates and times can be hard, but adding days to a date time column value isn’t. This tutorial shows you how to add …

Continue Reading

JavaScript — Prevent Line Breaks in String Template Literals

Template literates in JavaScript are delimited with backticks and allow you to create string interpolation and multi-line strings. A multi-line string with template literals is convenient because you can add words and line breaks without concatenating strings using a + across lines. A downside of multi-line strings in template literals: it …

Continue Reading

Node.js — What is `Symbol.iterator`?

JavaScript has support for iteration protocols. These iteration protocols aren’t built-in implementations, but protocols outlining the convention that an implementation needs to follow. The Iteration protocol allows custom JavaScript objects to provide iteration behavior, for example how they provide values when looping over them in a for…of loop. …

Continue Reading

Explore the Library

Find interesting tutorials and solutions for your problems.