๐ ๐ฐ ๐บ๐ฎ๐ถ๐ป ๐๐ฎ๐๐ฎ๐ฆ๐ฐ๐ฟ๐ถ๐ฝ๐ ๐บ๐ฒ๐๐ต๐ผ๐ฑ๐ ๐๐ผ ๐ฟ๐ฒ๐บ๐ผ๐๐ฒ ๐ฒ๐น๐ฒ๐บ๐ฒ๐ป๐๐ ๐ถ๐ป ๐๐ต๐ฒ ๐ฎ๐ฟ๐ฟ๐ฎ๐:
๐ฝ๐ผ๐ฝ -Removes from the end of an Array.
๐๐ต๐ถ๐ณ๐ - Removes from the beginning of Array.
๐๐ฝ๐น๐ถ๐ฐ๐ฒ -removes from a specific array Index.
๐ณ๐ถ๐น๐๐ฒ๐ฟ -allows you to programmatically remove elements from array.
but here I'm going to look at two most used methods
splice and filter.
- Splice():
when you use a splice, you need to find the index to the array element you want to remove using indexOf() and then remove that index with splice.
The splice () method changes the contents of an array by removing the existing element
array.splice((array).index0f(element_To_be _removed),1)
- filter ():
here is the code for the filter
myArray.filter(obj => obj !== myobject)
anyone who wants to explain more how filters work, you can share in the comment section
Top comments (0)