Short Pieces

JavaScript Get Yesterday's Date Easily

Learn how to get yesterday's date in JavaScript with simple code examples. A beginner-friendly guide using the Date object to subtract one day.

TypeScript Type Vs Interface? The Answer Is Type!

Still wondering about "TypeScript Type vs Interface"? The answer is type. Learn why TypeScript type aliases are more flexible and better suited for modern development than interfaces.

How to Omit Multiple Keys in TypeScript

Learn how to omit multiple keys in TypeScript with simple examples. Understand how to use Omit, Exclude, keyof, and Pick properly to create cleaner types.

How to Use satisfies in TypeScript

Learn how to use the satisfies operator in TypeScript to enforce stricter type safety. See comparisons with as and extends, and explore real examples.

How to Use Discriminated Unions in TypeScript?

Learn how to use discriminated unions in TypeScript to simplify complex logic, improve type safety, and enable precise type narrowing in your code.

How to Use as const in TypeScript Effectively

Learn how to use as const in TypeScript to create readonly literal types, improve type safety, and write more predictable, bug-resistant code.

Overloading vs Overriding in TypeScript

Learn the difference between overloading and overriding in TypeScript, with examples and how overriding connects to the Liskov Substitution Principle.

How to Return Multiple Values in JavaScript

Need to return 2 values from a JavaScript function? Learn the best ways using arrays, objects, and ES6+ features for clean, readable code.

How to Check if Object Is Empty in JavaScript

Struggling to check if a JavaScript object is empty? Here’s the simplest, fastest, and safest way to do it in modern JS.

How to Sort by Date in JavaScript?

Learn how to sort by date in JavaScript with simple examples. Sort arrays of date strings or objects with date fields using JavaScript’s sort() method.
1 2
Scroll to Top