abinjohn.inPure and Impure Functions in JavaScript"Pure" and "Impure" are two terms that are often associated with functions in JavaScript, especially in React Components. This post explains what they are, how they differ, and whether you should try to write pure functions all the time. Purity and I...Mar 2, 2023·4 min read
abinjohn.inIntroduction to JavaScript Spread Syntax & Rest ParameterThe Spread syntax and Rest parameter are two powerful concepts that were introduced to the JavaScript language with ES6 in 2015. At first glance, the two look similar, and developers who are just discovering the three dots often have a hard time figu...Feb 12, 2023·6 min read
abinjohn.inArray & Object Destructuring in JavaScriptIntroduction Destructuring is a JavaScript technique to extract values from arrays and objects quickly. Traditionally, we use indices to get values from arrays and properties (keys) to get values from objects. With destructuring, it is possible to ex...Feb 8, 2023·5 min read
abinjohn.inThree Reasons Why JavaScript forEach is SpecialThe other day, I found an interesting code snippet in the 'Spot The Bug' section of a Bytes newsletter. Can you spot it? const getCapitalizedInitials = (name) => name .trim() .split(" ") .forEach((name) => name.charAt(0)) .join("") ...Jan 29, 2023·4 min read
abinjohn.inObject Mutability in JavaScriptJavaScript is a funny language. If we declare a primitive variable with const and try mutating(modifying) it, we'll get an error. Well, that's expected behavior. However, if we declare an array or an object with const and try modifying one of its pro...Jan 23, 2023·8 min read