Kritika Mehta
Kritika Mehta

Reputation: 101

How to reverse the array in typescript for the following data?

0:"Both"
1:"Prepaid"
2:"Recoverable"

How to reverse the above array in typescript?

Upvotes: 10

Views: 9069

Answers (2)

Akitha_MJ
Akitha_MJ

Reputation: 4294

Just Add .reverse()

yourArray.reverse()

Upvotes: 1

Mykola Shchetinin
Mykola Shchetinin

Reputation: 747

As stated here:

yourArray.reverse() // will return reversed array

It is JS, but the method must be also in TS

Upvotes: 15

Related Questions