Options
All
  • Public
  • Public/Protected
  • All
Menu

Type aliases

Type aliases

Add

Add<N1, N2>: N1 extends unknown ? N2 extends unknown ? _Add<IterationOf<N1>, IterationOf<N2>>[0] : never : never

Add a [[Number]] to another one

Type parameters

  • N1: number

    Left-hand side

  • N2: number

    Right-hand side

returns

string | number | boolean

example

import {N} from 'ts-toolbelt'

type test0 = N.Add<'2', '10'>        // '12'
type test1 = N.Add<'0', '40'>        // '40'
type test2 = N.Add<'0', '40', 's'>   // '40'
type test3 = N.Add<'0', '40', 'n'>   //  40
type test4 = N.Add<'-20', '40', 's'> // '20'
type test5 = N.Add<'-20', '40', 'n'> //  20

  • Inherited
  • Protected
  • Private
  • Static
  • Module
  • Object
  • Property
  • Function
  • Variable
  • Index
  • Type
  • Class
  • Interface
  • Enum
  • Constructor
  • Getter/Setter
Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.