Inside our README.md we could have made informative drawings to explain some control flow or architecture, written in the great mermaid language. We certainly want these drawings to…
With the upgrades of the language that started in 2015, with ES6 and succeeding versions, the class syntax was added. Since it took…
Uncaught TypeError: Cannot read property ‘x’ of undefined
We often deal with dynamic data in complex structures in all web applications (browser + node.js) which, when we try to use that data, might produce unexpected behaviors and errors.
Let’s look at a small example where we have a collection
items (key indexed) of objects with certain properties. We need to get hold of an item's parent, and some properties from that parent item. It could look like this:
But this is a whole bunch of…
It is a good idea in unit testing to try to test at the highest possible level — focusing on testing of the module’s API from an outside/usage perspective. That way, we ensure that it does what it should, but we don’t care exactly how — making refactoring of the module almost zero work when it comes to updating tests. However, this often increases the amount of async testing.
In cases where the calls…