How to get latest commits and branch
5th July 2025Git does not directly store the creation date of a branch, so there's no built-in Git command to list recently created branches in order of their creation. However, you can approximate this using commit information. git for-each-ref --sort=-committer...Read more
JavaScript Throttling and Debouncing Functions Explained: Optimize Your Code
12th January 2023The idea to define the function is to call them only after some given time. The DOM events change rapidly, and calling them without any resistance can make function requests rapidly. Throttling and Debouncing are the methods for such ideas. Why Throt...Read more
Explaining the Key Differences Between Browser JavaScript and Node.js Event Loops
28th December 2022Comparison in the big picture 🌄 There are a few key differences between the event loop in browser JavaScript and the event loop in Node.js: Execution environment: While the event loop in Node.js runs inside a separate JavaScript runtime, the event...Read more
Ways to get input from node js command line program.
22nd December 2022Input from a command-line interface (CLI) application can be received in Node.js in a number of different ways. The following are a few of the most typical methods: 1. process.argv The arguments given from the command line to the Node.js process when...Read more
Count different values present in an array
10th November 2022Method 1: If you know the values which are present in an array, and those known values are in another array for reference. If you got confused, let it go I am sharing an example now: Example: const knownVal = ['sun', 'earth', 'moon']; const countingA...Read more