Skip to content

Instantly share code, notes, and snippets.

@othree
Created May 6, 2015 08:14
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 othree/17e9fb5614c0e3a4eb2e to your computer and use it in GitHub Desktop.
Save othree/17e9fb5614c0e3a4eb2e to your computer and use it in GitHub Desktop.
var removeElements = function(head, val) {
if (head === null) { return null; }
if (head.val === val) {
return removeElements(head.next, val);
} else {
head.next = removeElements(head.next, val);
}
return head;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment