Modify the function to return true if the given decimal is even when it is rounded to the nearest integer, and false otherwise 1 function isRoundedNumberEven(decimal) t 5 * Do not modify code below this line 6 7 console.log(İsRoundedNumberEven(2.2),'<-- console.logCisRoundedNumberEven(2.8), should should be be true'); false;

Respuesta :

Answer:

The function solution is in JavaScript

Explanation:

function isRoundedNumberEven(decimal) {

   return Math.round(decimal) % 2 === 0;

/* the modulus 2 operation is used for numbers divisible by 2 */

/* This indicates even numbers */

}

console.log(isRoundedNumberEven(2.2));

console.log(isRoundedNumberEven(2.8));