JavaScript/TypeScript

Sponsored links
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 important...
JavaScript/TypeScript

TypeScript Utility types defined with infer keyword

infer keyword is one of the difficult features that TypeScript offers. Some utility types use infer keyword, so let's le...
JavaScript/TypeScript

TypeScript How to set a default value with Interface

This page shows 3 ways to set default values to an interface. Using Spread Operator is an easy way. You can also define the default values in a function. An advanced way is to create a class for it.
JavaScript/TypeScript

node-serialport throws “File not found” error for a certain device when using USB-COM interface

I needed to use node-serialport to use a scanner for my project. I have two scanners. One of them works fine but another...
JavaScript/TypeScript

Implement IoT State Machine Transition By State Pattern In TypeScript

In my project, my team needed to implement State machine. One of the developers implemented it by using many if-else but...
Sponsored links