How To Cache Images – React Native Expo (Managed)

photo 1571858253340 84d2811a8d7e

Caching images in React Native can be easy, even if you are using Expo’s managed workflow. The problem many devs run into is that React Native only supports caching images on IOS out of the box. Other popular community packages that work on Android contain native code, and as such don’t work with Expo’s managed …

Read more

JavaScript With Statement Explained – A Deep Dive

photo 1529156069898 49953e39b3ac

JavaScript’s built-in with statement specifies the default object for the given property and gives us a shorthand for writing long object references. More precisely, it adds the given object to the head of the scope chain. Note: Use of the with statement is discouraged. It can lead to strange bugs. That said, it’s important to …

Read more

JavaScript Map Function Explained – A Deep Dive

photo 1502209524164 acea936639a2

The built-in JavaScript map function returns a new array, where each element in the new array is the result of the corresponding element in the old array after being passed through a callback function. Later in the article, we’ll do a deep dive into some more advanced concepts regarding the map function and its uses. …

Read more

How to Recursively Traverse JSON Objects

photo 1527266237111 a4989d028b4b

I’ve found that it’s quite rare to require recursion in application code, however, every now and then I need to write a function that operates on a tree of unknown depth, like a JSON object, and it’s often best done recursively. While recursion can be rare, it’s important to at least be able to recognize …

Read more

Secure Random Numbers in Node JS

Randomness is a hard problem for computers. Most functions that generate randomness are not considered cryptographically secure. What this means is that it’s possible for attackers to take a good guess at what number a non-secure randomness generator generated. In the case of guessing a randomly generated private key, for example, this can be catastrophic. …

Read more