TIL AVL Tree

May 29th, 2018 #TIL, Data Structures & Algorithms Kerry 1 min read

AVL (2 scientist guys’ last names: Adelson-Velsky and Landis) Tree is a special BST (binary search tree). It solves the problem of a BST becoming unbalanced, which at its extreme, results in a linked list. It achieves this by recursively asking “Am I balanced?” after a new node is added. If the answer is “NO!” then single or double rotations need to occur depending on…

TIL Bloom Filter

May 20th, 2018 #TIL, Data Structures & Algorithms, JavaScript Kerry 1 min read

Refreshing some computer science concepts by taking Brian Holt’s course on FrontendMasters.com. The first part lesson was on Bloom Filter’s, which sounded complicated and scary. The concept ended up being easy to grasp and he presents a great example of a practical application. The devil is obviously in the details but knowing a tool exists and the reasons to use it is always a step…

TIL: Abstraction

Mar 25th, 2018 #TIL Kerry 1 min read

To quote Kyle Simpson, “Abstraction is about creating semantic boundaries between things.” This separation allows us to think about, reason about, and prove each individual piece. This is different than “hiding details” as that can better be described as encapsulation.  

TIL: -0

Mar 21st, 2018 #TIL, JavaScript Kerry 1 min read

Prior to ES6, the only way to check if a number is -0 is to divide any number by it and check if it equals -Infinity. With ES6, you can use Object.is(value, -0).  

TIL: NaN !== NaN

Mar 21st, 2018 #TIL, JavaScript Kerry 1 min read

NaN does not follow the identity property. NaN is the result of trying to convert a non-number to a number. NaN with any other operation is going to produce NaN. Number.isNaN does not convert prior to checking if a value is NaN. window/global.isNaN does. In ES6, you can check for NaN equality using Object.is().

TIL Relative Margin & Padding Are Calculated From the Parent’s Width!

Sep 6th, 2017 #TIL, CSS Kerry 1 min read

The learning is coming fast & furious these days. I’m only on my sixth TIL post though so Vin Diesel’s still got me by two movies and two billion dollars if I’m rounding up. This one’s a quickie! And totally makes sense but I never use CSS much these days and if I do it’s usually a CSS framework. Like the title says, Relative margin…

TIL I Can Control .history

Sep 1st, 2017 #TIL, JavaScript, ReactJS Kerry 2 min read

Lots of turmoil and heated debate in the US surrounding history and who we immortalize in marble and bronze. Fortunately this blog is neither Politico or Fox News and you don’t have to hear me weigh in. The history that I’m talking about is **drumroll** browser history. If you’re wondering why it took so long to discover this, I mean, it’s only been out since Chrome version…

TIL Arrow Function

Feb 9th, 2017 #TIL, JavaScript Kerry 2 min read

TIL that the arrow function introduced in ES6/2015 is NOT just short-hand for a normal function declaration. It uses lexical this scoping rather than the dynamic. Kyle Simpson argues in his excellent series You Don’t Know JavaScript that this was created in part because people misunderstand how this works and how to utilize bind. Take the following example:

The above function’s setTimeout call-site is the global scope. This…

TIL Hoisting

Feb 9th, 2017 #TIL, JavaScript Kerry 1 min read

Today’s nugget of information is brought to you by McDonald’s 6-piece Chicken McNuggets. Hoisting in JavaScript is when the compiler performs all declarations at the beginning of a scope. TIL that the following single line of code is interpreted by the compiler as two lines:

This is why functions created by variable assignments cannot be used prior to assignment unlike regular function declarations, i.e.

Inaugural TIL

Feb 7th, 2017 #TIL, JavaScript Kerry 1 min read

TIL stands for Today I Learned. Starting today, I’ll be posting daily about one thing I learned related to web/game development and engineering. My way of trying to aspire to freeCodeCamp’s #100DaysOfCode challenge. To kick things off, today I learned that in Javascript, if not in strict mode, making an assignment to an undeclared variable, no matter how nested the scope, will result in the variable being…