Generation

generate functionWed, 03 May 2023

Solicitar un año y determinar si ese año hubo juegos olimpicos o mundial de futbol, usando mod Facil

function olimpicos(year){ if( year % 2) { console.log(year + " si hubieron olimpicos") } else { console.log(year + " no hubieron olimpicos") } } olimpicos(2019) // 2019 si hubieron olimpicos olimpicos(2020) // 2019 no hubieron olimpicos

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant