menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Types from...
source image

Medium

1M

read

141

img
dot

Image Credit: Medium

Types from Typescript

  • Typescript introduces various types for defining variables:
  • Primitives types like Boolean, Number, and String are similar to JavaScript.
  • Typescript also includes composed types such as Array, Tuple, Enum, and Object.
  • The Any type represents any other type.
  • Null and Undefined have specific meanings where Null signifies empty or reset value, while Undefined is for unset values.
  • Unknown type is used when the type of data from external sources is unknown.
  • Void represents no type and is used for functions that don't return anything.
  • Never type signifies a type that never occurs, often seen in functions that always throw errors.
  • Generic type (T) allows accepting any type while enforcing type checking.
  • Unions and Intersections are essential for type declaration in Typescript.

Read Full Article

like

8 Likes

For uninterrupted reading, download the app