divided even odd number javascript code example
Example 1: javascript get every odd element
//you can use the css nth-child property like this:
var second-child = document.querySeletorAll('[your element name]:nth-child(odd)');
Example 2: if odd js
function isEven(value) {
return !(value % 2)
}
Example 3: sum of odd numbers in an array javascript without loop
var total = numbers.reduce(function(total, current) {
return total + current;
}, 0);
console.log(total);