Why can’t we use only reverse() as a function in React JS to reverse array data?
SandiniJ
Check this article
https://crawlee.space/d/65-arrayreverse-for-reversing-an-array
. reverse () is a JavaScript inbuilt function. It can be applying for an array.
const dataArray=[“jana”, “book”,“tablet”] let reverseArray= dataArray.reverse()
const dataArray=[“jana”, “book”,“tablet”]
let reverseArray= dataArray.reverse()
I already tried this but it’s not working for me…
Try this code slice().reverse()
Thank you very much , It worked … 😃
sajeevan
Array.reverse() - for reversing an array