Answers for "par ou impar js"

0

par ou impar js

function iqTest(parOuImpar){
    let splitArray = parOuImpar.split(" ")
    for (let index = 0; index < splitArray.length; index++) {
        if((splitArray[index] % 2) == 1) {
            return splitArray[index]
        }  
    }  
}

console.log(iqTest("2 4 7 8 10"))
console.log(iqTest("1 2 2"))
Posted by: Guest on October-09-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language