JSFiddle - React, Tailwind, and code Playground

by rionmonster

JavaScript

var arr = ['test1', 'test2', 'test3'];

alert("Length before splice :" + arr.length);

var value_to_remove = 'test2';
arr.splice(arr.indexOf(value_to_remove), 1);

alert("Length after splice :" + arr.length);