Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

splice javascritp

let colors = ['red', 'blue', 'green'];

let index_element_to_be_delete = colors.indexOf('green');

colors.splice(index_element_to_be_delete); 

//Colors now: ['red', 'blue']
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #splice #javascritp
ADD COMMENT
Topic
Name
4+2 =