Skip to content

Python-like functions

range()

Similar usage as Python range()

ts
import {  } from '@vincent-the-gamer/utils'

(0, 5) // [0, 1, 2, 3, 4]
(0, 10, 2) // [0, 2, 4, 6, 8]
(0, -2, -1) // [0, -1]

all()

Similar usage as Python all()

ts
import {  } from '@vincent-the-gamer/utils'

const  = [
  10 < 11,
  'sasd'. > 0,
]

const  = [
  10 > 11,
  'sasd'. > 0,
]

() // true
() // false

any()

Similar usage as Python any()

ts
import {  } from '@vincent-the-gamer/utils'

const  = [
  10 > 11,
  'sasd'. < 0,
]

const  = [
  10 > 11,
  'sasd'. > 0,
]

() // false
() // true

divmod()

Similar usage as Python divmod()

ts
import {  } from '@vincent-the-gamer/utils'

(10, 3) // [3, 1]
(9, 3) // [3, 0]

Document by Vincent-the-gamer | MIT Licensed