if else

basic

// if(condition) then result
// else result
const dataOne = 1
const dataTwo = 2

if(dataOne > dataTwo) // if 1 > 2
    console.log('dataOne is more then dataTwo')
else // 1 < 2
    console.log('dataOne is less then dataTwo')

Last updated

Was this helpful?