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.


Sort an Array of Integers in JavaScript and Node.js

Sorting data is a common task in programming. JavaScript provides a .sort(comparator) method on arrays allowing you to sort data with custom comparator. A comparator represents a compare function determining which element comes before the other. When sorting integers, a custom compare function comes handy because you can ensure …

Continue Reading

GitHub Actions — Using MongoDB Replica Sets

GitHub Actions let you automate tasks on your repositories. For example, you can move your entire CI/CD pipeline to GitHub using Actions. You probably need a database when running your tests. MongoDB recommends using replica sets in production environments. You can push your testing environment as close to the …

Continue Reading

Node.js — How to Merge Objects

Merging objects in JavaScript is a common task. For example, when starting an application you may load multiple configuration files and merge them into a single configuration object. This tutorial shows you how to merge objects in JavaScript. {{outline}} Merge Objects Merging objects in JavaScript is possible in different ways. …

Continue Reading

Increase a Date in JavaScript by One Week

When building tools that work with dates, you may want to provide a button that acts as a shortcut to increase a date by one week. Internally, your application still works with actual dates and you may want to calculate the date in one week. This tutorial shows you how …

Continue Reading

Get Tomorrow’s Date in JavaScript

Imagine a planning tool like a ToDo-list where you want to schedule a task due for tomorrow. Clicking a button “plan for tomorrow“ sets the due date to tomorrow. Your database still needs an actual date as the deadline. This tutorial shows you how to retrieve tomorrow’s date in …

Continue Reading

Explore the Library

Find interesting tutorials and solutions for your problems.