Skip to content

Instantly share code, notes, and snippets.

@appoll
Created May 31, 2021 18:39
Show Gist options
  • Save appoll/17ca374f7aded4a35de69d6be657e495 to your computer and use it in GitHub Desktop.
Save appoll/17ca374f7aded4a35de69d6be657e495 to your computer and use it in GitHub Desktop.
// Work with functions that take as parameters arrays (one or more)
// E3. Write a function that returns the sum of all elements in an array
function addArrayElements(array){
return sum; // number
}
// E3.a Modify the function to only return the sum of all even elements;
// E4. Write a function that returns boolean true if an array contains a specific number (also given as parameter)
function containsElement(array, number){
// returns boolean
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment