Computer Science, asked by akash21212146, 11 months ago

Given the value of a variable ,write a statement ,without using if construct ,which will produce the absolute Value of the variable​

Answers

Answered by Anonymous
8

let counter = 0;

arrayOfIntegers.forEach((integer) => {

const remainder = Math.abs(integer % 2);

counter += remainder;

});

console.log(counter);

Similar questions