script (4) 썸네일형 리스트형 Decorator The decorator in TypeScript is a feature that enables us to add meta data or business logic without having to change the orginal code format. For example, when we have multiple classes with the same attribute name, type, with the same value, we can use the decorator to reduce redundancy How to Use It? This feature is in test at the moment, so we need a set up to use this. Open the console and ru.. JavaScript Module - Text Wave Effect Let's see how we can create a wave effect. The completed code looks like the one below. To make it easy to implement this feature to any existing website, I structured this to work by adding a class name to a text element. When you add the class name 'wave-text', the effect will take effect given that you have done the necessary configurations. // wave-module.js const waveTextEl = document.query.. Interface Interface is a class that defines attributes without initial values. It makes our life so much easier when we work with TypeScript as we can define a type once and use it across out application. How to Use It? Let's see how we can make the code below simpler using the interface. let object: { name: string; age: number; married?: boolean } = { name: 'tom', age: 20, } Create a interface of the obj.. TypeScript JavaScript, as you know, is a weakly typed language. While this feature allows you to write a code easily and freely, it also make the language prone to logic error whick is very hard to find. TypeScript is a superset of JavaScript. It includes all the features from JavaScript and has an additional feature, yep! you guessed right: type checking which makes it easier to find logic errors early in.. 이전 1 다음