I decided to write about sparse and dense arrays several months ago. I thought it would be easy and imagined writing a masterpiece based off my multi-year experience with arrays. Alas, my foray into the intricacies of Arrays unearthed surprising discoveries and shattered my brittle expertise. This series of posts describes my learnings and Aha moments.
Now that you know some more about JSON.stringify; let's dive into its complement: JSON.parse. 1. JSON.Parse The JSON parse function takes in a string (invalid JSON will cause a SyntaxError exception). If parsing succeeds, JSON.parse returns the corresponding value or object. 2. The reviver function JSON.parse accepts an optional reviver function. This reviver function, if specified, allows you … Continue reading What you didn’t know about JSON.parse
I recently had to reduce the size of an Angular Web app for performance reasons. A quick run through the webpack bundle analyzer identified MomentJS and Lodash as the main culprits. Consequently, I had to eliminate both libraries and implement replacements in pure ES6. The upside however is that it was easier than I thought! Thus, … Continue reading Nope, You don’t need lodash for that
I started poking into core Angular 2 concepts a few weeks ago and it has been a pleasant experience so far. I rewrote a bare-bones replica of an Angular 1 app that took me months in about 2 or 3 weeks. Although rewrites are typically faster due to familiarity, it was impressive seeing built-in support for … Continue reading Why I am moving to Angular 2
As part of my continuous learning; I started reading Tero Parviainen's 'Build your own AngularJS' about 6 months ago. After 6 months and 127 commits, I am grateful I completed the book. While I didn't take notes while reading, some ideas stood out. Thus, this post describes some of the concepts I have picked up from the book. The Good 1. Get … Continue reading Book Review:Build your own AngularJS
Collections abound everywhere in the real world and loops are very common in programming. A simple loop is shown below: Destructive loops Simple loops can be boring, after all, why not have the collection change during a looping operation for more fun? Won't happen? Believe me it does, have run into such at least twice. An example scenario … Continue reading Safely handling destructive loops
Lions at the zoo Zoos allow for safely viewing dangerous wild animals like lions. Lions are caged in their enclosures and can't escape its boundaries (if they did, it'd be chaos eh?). Handlers, however, can get into cages and interact with them. Like cages, you can think of variable scoping rules as establishing the boundaries and walls in … Continue reading Learning ES2015 : let, const and var