Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
wk10 quiz
// given array, indicate all evens and all odds
array = [2,3,4,5,6,7,8,9,10,13,15,16,17,19,20,25,26,28,50,51,57,58,72,75,101,207,333,344,367,401,405,788,909]
for (x=0; x < array.length; x++){
if( array[x] % 2 == 0 ){
console.log("this is even")
};
else{
console.log("odd")
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.