export const getLesserEvil = (threat1, threat2) => {
if (threat1 < threat2 )
return 'evilFactor'
}

please help am having issues with this task

    No, let me try again

    I am having a problem this project please help

    This is my code below:
    export const getLesserEvil = (threat1, threat2) => {
    if(threat1 < threat2){
    return threat1;
    }else{
    return threat2;
    }

    }

    It returns the first instruction correctly but doesn't for the second.

    {
    description: 'Mass extinction from the global pandemic',
    evilFactor: 3
    }
    {
    description: 'Mass extinction from the global pandemic',
    evilFactor: 3 }.

    I also tried changing the sequence(writing if(threat 1 > threat 2) first but it just interchanges the results).

      I try that earlier didnt work

      Write a Reply...