DEV Community

Tomohiro Yanagi
Tomohiro Yanagi

Posted on

Get a new array with specific value removed

delete(array, value) {
    const index = array.indexOf(value);
    return [...array.slice(0, index), ...array.slice(index + 1)]
}

Top comments (0)