Pure 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...4VAPMar 2, 2023 · 4 min readabinjohn.hashnode.dev
Introduction 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...4NAAFeb 12, 2023 · 6 min readabinjohn.hashnode.dev
Array & 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 readabinjohn.hashnode.dev
Three 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 readabinjohn.hashnode.dev
Object 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...2ASJan 23, 2023 · 8 min readabinjohn.hashnode.dev