Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript delete user input value in array

var array = ['one','two','three',4,5,6,7,8,9,10];
var remove = function(removeID){
    var index = array.indexOf(removeID);
    if (index>-1) {
        array.splice(index, 1);
    }
}
remove(prompt("Enter ID of the worker you wish to remove: "));
console.log(array);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #delete #user #input #array
ADD COMMENT
Topic
Name
4+3 =