export const getLesserEvil = (threat1, threat2) => {
if (threat1 < threat2 )
return 'evilFactor'
}
please help am having issues with this task
export const getLesserEvil = (threat1, threat2) => {
if (threat1 < threat2 )
return 'evilFactor'
}
please help am having issues with this task
ali why do you return the string evilFactor
? Was it mentioned somewhere in the task description?
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).
Anonycyb-9J I didn't know the solution has been posted by Coderslang_Master in another thread.
Turns out I was missing the .evilFactor from my code
I try that earlier didnt work