We, programmers, play with Arrays all the time, and yet most of the time we don’t know all helper functions provided by the TypeScript.
Pre-built functions have always been proved time-savers. Find the list of utility functions in typescript with demonstrations.
I have listed out 20 methods that you need to know, with fun emojis.
- indexOf()
- lastIndexOf()
- concat()
- join()
- push()
- pop()
- reverse()
- shift()
- unshift()
- slice()
- splice()
- toString()
- filter()
- map()
- every()
- reduceRight()
- reduce()
- some()
- sort()
- fill()
Full article with example available an on canopas blog.
The full source code is available on Github.