Is there another way than pop() to remove values in array in js? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 2

Is there another way than pop() to remove values in array in js?

It lags because of the arrays Here's the code: https://code.sololearn.com/WVnjQ3jMVX2H/?ref=app

5th Jul 2018, 4:00 AM
TerrIA
TerrIA - avatar
3 ответов
5th Jul 2018, 4:59 AM
ODLNT
ODLNT - avatar
0
You can use the arrayObject.filter() method to remove elements from an array at specific index in JavaScript. var rValue = 'three' var arrayItems = ['one', 'two', 'three', 'four', 'five', 'six'] arrayItems = arrayItems.filter(item => item !== rValue) console.log(arrayItems) http://net-informations.com/js/progs/remove.htm
15th Nov 2021, 4:30 AM
creigmalta