Home Angular 8 Angular 9 – how to remove last array element?

Angular 9 – how to remove last array element?

by therichpost
Published: Last Updated on 0 comment
Angular 9, Angular 10

Here to all, welcome to therichpost.com. In this post, I will tell you, Angular 9 – how to remove last array element?

Here is the code snippet and you can add this into to your app.component.ts file:

let array_1 = [1,2,3,4];
array_1.splice(-1,1)  //  output--> array_1 = [1,2,3]

If you have any kind of query then please comment below.

jassa

Thanks

You may also like

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.