DEV Community 👩‍💻👨‍💻

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

Posted on

Javascript Tagalog - Array Unshift 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 Pop method sa Javascript?
yung Array unshift method sa javascript is maglalagay siya ng values sa unahan ng array

Pano gamitin:

const arr = [4,5]


console.log( arr ) // [3,4,5]

//Pwede multiple arguments ilagay mo

console.log( arr ) // [1,2,3,4,5]

Enter fullscreen mode Exit fullscreen mode

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

const arr = [2,3]

const returnValue = arr.unshift(1)

console.log( returnValue ) // 3

Enter fullscreen mode Exit fullscreen mode

yung return value ng unshift method is yung bagong length ng array after natin maglagay ng bagong element

baka oversimplified,inacurrate information nasulat ko so here's a better in depth documentation (english)
MDN Documentation - Array unshift method
More tagalog Javascript Learning Resources:

Top comments (0)

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.