AKAlex Kanginalexkang.hashnode.dev·May 11, 2023 · 2 min readUseful Git CommandsKnowing useful git commands can greatly help the development workflow. Here are some useful git commands and options that not everyone might know. 1. git status git status shows what files have been changed from the current HEAD commit. When you run ...00
AKAlex Kanginalexkang.hashnode.dev·May 5, 2023 · 2 min readCallbacksIn JavaScript, functions can be treated like any other variable. So, it can be passed into a function and returned from a function. A callback function is a function passed into another function as an argument. Let's look at an example. // callback...00
AKAlex Kanginalexkang.hashnode.dev·May 4, 2023 · 2 min readClosureAfter a function finishes executing, the local variables of the function are no longer available. What if we want to keep the state of the variables between multiple function calls? That's where JavaScript closures come in. A closure is when an inn...00
AKAlex Kanginalexkang.hashnode.dev·May 3, 2023 · 5 min readLRU Cache (LeetCode)Problem Description https://leetcode.com/problems/lru-cache/ Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. Implement the LRUCache class: LRUCache(int capacity) Initialize the LRU cache with positive size ...00