Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Last active August 11, 2021 11:06
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 McLarenCollege/02732c9b946f1b831336e79ad2dc78a6 to your computer and use it in GitHub Desktop.
Save McLarenCollege/02732c9b946f1b831336e79ad2dc78a6 to your computer and use it in GitHub Desktop.
Delete First Even Number

Given an array write code to delete the first even element from the array and return the modified array.

Note: You can create a new array and return it

let arr = [1,5,9,8,6,4,5,2,5];
function deleteFirstEven(arr){
//write code here
}
deleteFirstEven(arr); // should return [1,5,9,6,4,5,2,5]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment