Search
 
SCRIPT & CODE EXAMPLE
 

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);
Comment

PREVIOUS NEXT
Code Example
Javascript :: datatables keep order and page selection page refresh 
Javascript :: how to pass sequelize transaction to save method 
Javascript :: react vscode stop auto close tag 
Javascript :: audio element javascript 
Javascript :: react route props 
Javascript :: how to create an array in javascript 
Javascript :: Iterate with Do While Loops Javascript 
Javascript :: Slice and Splice -Javascript 
Javascript :: js redux example 
Javascript :: nuxt get client windows size 
Javascript :: create or update in sequelize 
Javascript :: javascript iterate through object attributes 
Javascript :: vs code file nesting 
Javascript :: is dark mode 
Javascript :: how to use nodemailer 
Javascript :: javascript debugger online 
Javascript :: The removeChild() Method 
Javascript :: javascript add parameter to object 
Javascript :: luxon plus 
Javascript :: mongodb find element in array 
Javascript :: arrow function javascript 
Javascript :: object promise javascript 
Javascript :: sort algorithm for array of objects in js 
Javascript :: javascript swap 
Javascript :: angular multiselect dropdown 
Javascript :: react receiving socket muitple times 
Javascript :: Setting darkmode using Tailwind 
Javascript :: repeat js 
Javascript :: route guard in react js 
Javascript :: javascript regex match sequence 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =