Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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"))
Comment

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"))
Comment

PREVIOUS NEXT
Code Example
Javascript :: Environment key "jest/globals" is unknown 
Javascript :: untrack package-lock.json 
Javascript :: reverse a string in javascript 
Javascript :: first N elements of an array javascript 
Javascript :: generator function fibonacci 
Javascript :: how to use jszip in node.js 
Javascript :: how to add data to array in javascript dynamically 
Javascript :: sequelize get where 
Javascript :: this.setstate is not a function 
Javascript :: javascript rock paper scissors 
Javascript :: js sort 
Javascript :: react extends component construtor super props 
Javascript :: javascript redirection 
Javascript :: lifecycle state: defunct, not mounted 
Javascript :: array of string mongoose 
Javascript :: react using proptypes 
Javascript :: find smallest number in array javascript using for loop 
Javascript :: append after div 
Javascript :: innertext javascript 
Javascript :: media query in jsx 
Javascript :: print page using js 
Javascript :: socket io query 
Javascript :: bootstrap open tab from link data-toggle="tab" 
Javascript :: how to convert a string to react element in javascript 
Javascript :: bootstrap react 
Javascript :: media queries generator script 
Javascript :: how to get url parameter using jquery or plain javascript 
Javascript :: run function on page resize javascript 
Javascript :: simple js drawing program 
Javascript :: react arrow funvtion 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =