Korisne prečice za JavaScript i TypeScript

https://blog.logrocket.com/16-useful-typescript-ja... link-img
avatar

JavaScript and TypeScript share a number of useful shorthand alternatives for common code concepts. Shorthand code alternatives can help reduce lines of code, which is something we typically strive for.

In this article, we will review 16 common TypeScript and JavaScript shorthands. We will also explore examples of how to use these shorthands.

Read through these useful JavaScript and TypeScript shorthands or navigate to the one you’re looking for in the list below:

  • Ternary operator
  • Short-circuit evaluation
  • Nullish coalescing operator
  • Template literals
  • Object property assignment shorthand
  • Optional chaining
  • Object destructuring
  • Spread operator
  • Object loop shorthand
  • Array.indexOf shorthand using the bitwise operator
  • Casting values to boolean with !!
  • Arrow/lambda function expression
  • Implicit return using arrow function expressions
  • Double bitwise NOT operator
  • Exponent power shorthand
  • TypeScript constructor shorthand
2

ULOGUJ SE I DODAJ KOMENTAR


Registruj ili prijavi.

VIDI POPULARNE POSTOVE


3
avatar Ivan pre 20 sati
4
avatar Nevenka pre 23 sata
1
avatar Vukašin pre 23 sata
1
avatar Ivana pre 4 dana
8
avatar Strahinja pre 8 dana
5
5
avatar Nevenka pre 14 dana
3
avatar Vukašin pre 15 dana
5
2
avatar Strahinja pre 15 dana
4
4
avatar Stefan pre 16 dana
5
avatar Vukašin pre 18 dana