JavaScript Map Function Explained – A Deep Dive

We are going to walk through the JavaScript map function. I’ll explain how it works in a simple way. Later in the article, we will do a deep dive into some more advanced concepts regarding the map function and its uses. Map Function Syntax From Mozilla’s definition: The Array object’s map method takes a function … Read more JavaScript Map Function Explained – A Deep Dive

Benchmarking Array Traversal in Javascript – Going Backwards is Fastest

There are many ways to traverse an array in Javascript. In this benchmark, we will look at five different ways and the pros and cons of each. Keep in mind that these benchmarks were run in a Chrome browser on Codepen. Results will vary by browser/interpreter. For a working example of these benchmarks, take a … Read more Benchmarking Array Traversal in Javascript – Going Backwards is Fastest

Singletons in ES6 – The Good, The Bad, The Ugly

Singletons are fairly controversial as far as I can tell, especially in Javascript programming. Let’s take a look at what they are, when to (maybe) use them, and when not to. What is a Singleton? A singleton is a class that allows only a single instance of itself to be created and gives access to … Read more Singletons in ES6 – The Good, The Bad, The Ugly

Constants in Go vs Javascript, and When to Use Them

Constants can be confusing and easy to misuse in Go if you are coming from an untyped language. In this article we will learn what constants are, and when it is best to make use of them. Most of the points I make here apply to general-purpose programming languages as a whole, but by focusing … Read more Constants in Go vs Javascript, and When to Use Them

Thinking about Recursion: How to Recursively Traverse JSON Objects and the Filesystem

I work primarily on application-level programs, so I tend to not use recursion very often. However, every now and then I need a function that is best solved recursively. It is important to be able to recognize when a problem is best solved recursively, and to be able to write it when the time comes. … Read more Thinking about Recursion: How to Recursively Traverse JSON Objects and the Filesystem

How to Make a Custom Select Component in Vue.js

Customizing the design of a select tag is notoriously difficult. Sometimes it’s impossible without building your own from scratch using a combination of styled divs with custom JavaScript. In this article, you will learn how to build a Vue.js component that can be styled using completely custom CSS. Demo: https://codesandbox.io/s/custom-vuejs-select-component-8nqgd The HTML The following is … Read more How to Make a Custom Select Component in Vue.js

Randomness and Entropy in Node and Electron

http://thehobbyts.com/fun-dice-games-ultimate-list/

Randomness is a hard problem for computers. For this reason most functions that generate randomness are not considered cryptographically secure. That means that it is possible that an attacker can take a good guess at what number a non-secure randomness generator generated. How can randomness be attacked? Many non-secure randomness (or entropy) generators would do … Read more Randomness and Entropy in Node and Electron