JavaScript/TypeScript

JavaScript/TypeScript

How to sort Array if it contains number string and string data in JavaScript

Doesn't Array.sort output as you expected? It's because number is handled as string by default. If you want to sort the array on your needs, you need to write your own sorting logic.
JavaScript/TypeScript

Implementing Treap data structure in TypeScript

This post explains what Treap is and how it can be implemented in detail. It is often used for the implementation of dictionary and set. It's worth knowing.
JavaScript/TypeScript

TypeScript Remove elements from an object array

Remove method doesn't exist on Array interface. So we need to implement it ourselves. This article explains how to remove elements from number/string/object array.
Sponsored links
JavaScript/TypeScript

Implementation of D Way Heap in TypeScript

Explains how D-way heap works and how it can be implemented in TypeScript. If you need to update/remove an element, it does it in a very short time.
JavaScript/TypeScript

FATAL ERROR: invalid array length Allocation failed

Isn't there an infinite loop in your code? Don't you edit an array in the loop? If so, use the copy instead.
JavaScript/TypeScript

TypeScript Find the lowest missing number in an array

It explains how to find the lowest missing number in an array. Not only for an array that starts with 0 but also starts with an arbitrary value. Furthermore, the step between the values can change.
JavaScript/TypeScript

TypeScript Cancellable sleep/delay

By using async/await keyword with Promise, you can easily implement sleep/delay function. Furthermore, this post explains how to implement to cancel the sleep/delay for some reasons.
JavaScript/TypeScript

Understanding how to use Symbol.iterator in JavaScript/TypeScript

Symbol.iterator can be used to initialize the iterator. If you need to go back to the first element after the iterator goes forward, it's the right place to use it. This post shows the example.
JavaScript/TypeScript

TypeScript keyof typeof for type generation

keyof extracts the keys of an interface or type and can be used to generate a new type. typeof generates a type from an object. The combination of keyof and typeof can generates a type from an object.
JavaScript/TypeScript

TypeScript Make the function parameter more maintainable by using interface

Many programming languages support interface keyword. TypeScript also supports the feature. This is one of the importan...
Copied title and URL