Skip to content

Instantly share code, notes, and snippets.

@frayhan32
Created September 23, 2014 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frayhan32/591ea3d80b4e99379bfc to your computer and use it in GitHub Desktop.
Save frayhan32/591ea3d80b4e99379bfc to your computer and use it in GitHub Desktop.
function findValueThenRemove(value){
var a = ['a','b','c','d'];
for(var i = 0 ; i<= a.length-1;i++){
if(a[i] === value){
a.splice(i,1);
}
}
alert(a);
}
findValueThenRemove('b');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment