12 Apr 2023
★ 5 min. read
What is a Javascript closure?
According to MDN: A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, a closure gives you access to an outer function’s scope from an inner function. In JavaScript, closures are created every time a function is created, at function creation time.
More …
25 Nov 2022
★ 5 min. read
The fetch native API is very powerful and simple to use. The downside is that it will only throw an error for network errors but not for HTTP errors such as 4xx or 5xx responses.
More …
25 Aug 2021
★ 10 min. read
What is one way for components to communicate in Angular? It is by using @Input
and @Output
. Yes we could always use a service, but in this post we will dive deeper into how does Angular know when to run its change detection when new data has been communicated.
More …
24 Aug 2021
★ 12 min. read
An Angular project is made up of many components. When the application starts up, Angular runs the bootstrap sequence to build our application for display to the users.
During the time when users are using the application, users click around to navigate between different pages. Components gets created, and components gets destroyed. But are those the only two stages of the lifecycle of a Angular component?
More …
09 Nov 2020
★ 5 min. read
RxJS is mostly useful for its operators, even though the Observable is the foundation. Operators are the essential pieces that allow complex asynchronous code to be easily composed in a declarative manner. If you have worked
with RxJs, you probably have used a operator or two.
In this post, I want to highlight 4 most commonly used transformation operators. Transformation operators are operators that transforms data.
More …
18 Dec 2019
★ 4 min. read
If you are learning how to use a new Javascript framework or library, you might see the following command npx name-of-package
in the Getting Started section. You might say to yourself, wow they made a typo! Actually they did not. npx
and npm
are very different things, and it was meant to be used that way.
More …
22 Nov 2019
★ 2 min. read
There are truthy and falsy values in Javascript. Using them could shorten your conditional checks and more.
More …
19 Nov 2019
★ 5 min. read
Javascript is usually considered a wild wild west language. There are countless memes made about how Javascript is the weird and quirky
language that no one wants to touch. You can see many blog posts about it here and here.
In this post, I would like to explore some of the common gotchas of the Javascript language.
More …