JavaScript/TypeScript Extends interface and type in typescript We often need to build similar structures in different objects. Some functions require the same variables but want to ha... 2021.07.12 JavaScript/TypeScript
JavaScript/TypeScript Efficient Null Handling in Typescript Null check in many places is tedious. This post shows you how to reduce such work in a nice way. 2021.07.10 JavaScript/TypeScript
JavaScript/TypeScript Typescript enum get value by key and key by value Explains how to get value by key, get key by value, and use an enum as an object key. Some functions don't behave as expected when an enum has number values or mixed type data. All enum-related solutions are on this page. 2021.07.08 JavaScript/TypeScript
JavaScript/TypeScript TypeScript/JavaScript Spread operator (three dots) The spread operator (three dots) is used to copy an array and expand an array to pass the values to another object or function parameters. It can also be used as rest parameters in a function to indicate that the function can take as many arguments as you want. The spread operator is handled as a shallow copy. Therefore you need to be careful if you use it for an object that has objects in the property list. 2021.07.06 JavaScript/TypeScript
JavaScript/TypeScript Tips to reduce Node-RED flow conflicts It's hard to avoid merge conflicts when using Node-RED in a big project. I have fought against merge conflicts many time... 2021.06.30 JavaScript/TypeScript
JavaScript/TypeScript try-catch doesn’t catch an error thrown in timer try-catch doesn't catch an error thrown in timer friend functions setTimeout, setInterval and setImmediate.Using timer f... 2021.06.28 JavaScript/TypeScript
JavaScript/TypeScript Recursive setTimeout vs setInterval Recursive setTimeout and setInterval behave differently. You need to know the difference and which to use depending on the specification. This post explains how to implement it and the difference with images. 2021.06.26 JavaScript/TypeScript
JavaScript/TypeScript Nested class or inner class in Typescript Inner class or nested class can be defined if you assign a class with an equal operator. Another way is to define a function that returns an object. If you call the function somewhere, the object can be handled as a class. 2021.06.24 JavaScript/TypeScript
JavaScript/TypeScript Is Map object faster than if-else and switch? Using map object is useful to replace switch-case or if-else that can easily be long lines. It improves the readability but how about the performance? Is it faster than switch-case and if-else? Let's compare the difference! 2021.06.22 JavaScript/TypeScript
JavaScript/TypeScript Node-RED node test fails when using sinon.useFakeTimer Node-RED test fails when replacing timer related functions. Our own node derives Node-RED node and it calls setImmediate... 2021.06.18 JavaScript/TypeScript