DEV Community 👩‍💻👨‍💻

Cover image for Javascript Tagalog - Array Reverse Method
Mark Matthew Vergara
Mark Matthew Vergara

Posted on

Javascript Tagalog - Array Reverse Method


Disclaimer: This is a Blog i made with the initial intention of reinforcing my knowledge in JS. I just thought sharing my blogs might be helpful for someone since they are written in tagalog/taglish. Incase of Misinformation I won't be responsible for it and you can comment on the blog to address the mistake or email me. I'm always trying my best to be as accurate as possible. take a look at other resources just to be sure.

Ano ngaba ang Array Reverse method sa Javascript?
yung Array Reverse method sa javascript, rereverse niyalang yung original array.

Pano gamitin:

const arr = [1,2,3]

arr.reverse()

console.log( arr ) // [3, 2, 1 ]
Enter fullscreen mode Exit fullscreen mode

Return Value
ano yung value if lalagay mo siya sa variable?


const arr = [1,2,3]

const returnValue = arr.reverse()

console.log( returnValue ) // [3, 2, 1 ]

Enter fullscreen mode Exit fullscreen mode

return value ng reverse method is yung reversed na array, but becareful kasi same parin yung address sa memory so pag pinalitan mo or minodify mo yung returnValue variable, mapapalitan din yung arr variable

const arr = [1,2,3]

const returnValue = arr.reverse()

returnValue.pop()

console.log( arr ) // [3, 2,]
console.log( returnValue ) // [3, 2,]

Enter fullscreen mode Exit fullscreen mode

baka oversimplified,inacurrate information nasulat ko so here's a better in depth documentation (english)
MDN Documentation - Array Reverse method
More tagalog Javascript Learning Resources:
https://javascript-in-tagalog.netlify.app

Top comments (0)

🌚 Browsing with dark mode makes you a better developer by a factor of exactly 40.

It's a scientific fact.