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).