Oct 9, 2021Javascript — Error handlingWhy error handling? While we are executing code, we might encounter lots of errors including javascript error, system error or API returned error. Once the error occurs and we didn’t handle it properly, it will terminate code execution. …Asynchronous3 min read
Sep 11, 2021SQL — Select and LookupFollow up on the previous article about SQL CRUD https://toddypet.medium.com/sql-create-insert-f9afe47316b5. In this article, I will go through the command you need while selecting data with SQL. I will first introduce a strategy for data analysis and then go through the SQL command which maps with each step. Data analysis strategy …Sql3 min read
Sep 4, 2021SQL — Create, Update, DeleteIn this article. I will first explain some glossary from SQL then guide readers step by step on how to create a database, table, and add a record. Tools In this article, I will use SQLFiddle to create a table What is SQL Structured Query Language (SQL) can be classified…Sql4 min read
Aug 14, 2021Javascript — Asynchronous programmingIn this article, I will explain how to use Javascript for Asynchronous programming. Before we start, let’s first think about why we need Asynchronous programming. Asynchronous programming exists to solve the problem of blocking and save your time for waiting for the previous step to complete. In the below example…Asynchronous4 min read
Aug 7, 2021Authentication — Cookie v.s. JWTIn this article, I will explain why we need authentication and compare the difference between session-based authentication v.s. token-based authentication. How Authentication works To start with, let’s first think about how authentication works. user login username/password pass on to the server server verified the information and grant the permission by…Cookies3 min read
Jul 25, 2021Javascript — Event loopHave you ever seen the below code and wondering why people write something to wait for 0 sec? setTimeout( () => {console.log('wait for 0 sec')},0) It seems like a meaningless step as in real life you won't hold off someone and said wait for 0 seconds. However, this actually covers…Javascript Event Loop3 min read
Apr 10, 2021Javascript — Object DestructuringIn this article, I will explain object destructuring using pure Javascript and provide some examples of how I use it in my react project How to use it with pure Javascript basic extract The basic use of destructuring is to us {} to extract one or more properties from your…React3 min read
Jan 24, 2021JavaScript — DateTimeRecently I am working on an app that required me to compare the DateTime data from API between my local pc time. Below I have listed out some useful method that I always use to help me compare and present the right time Get local time By default, when you…Java Script3 min read
Dec 28, 2020Javascript — Const v.s LetConst and Let is a new feature introduced in ES6. This article will explain the difference and usage of const and let Definition First of all, let’s take a look at the definition in MDN Const : block-scoped, much like variables declared using the let keyword. The value of a…Java Script3 min read