I can only implement it correctly using the if statement. But the instruction is that I should not use any if. This is my attempt. Note I will write OR instead of the symbol because its displaying the symbol after posting. export const oneWillDo = (x, y, z) => { if ((x === true) OR (y === true) OR (z === true)) { return true; } else { return false; } }
Niyi try to log the value of this statement to the console (x === true) OR (y === true) OR (z === true) for different x, y and z.
(x === true) OR (y === true) OR (z === true)
Niyi Coderslang_Master
For task 127, it has been told not to implement the if statement.
Shorter way: export const oneWillDo = (x, y, z) => { return (x===true) OR (y===true) OR (z=== true) }
angelsrija the only thing that remains is to substitute OR with the correct JavaScript operator 🙂
OR
Coderslang_Master ``
export const oneWillDo = (x, y, z) => { return (x || y || z); }
@"alorenz"#p865 export const oneWillDo = (x, y, z) => { if(x || y || z){ return true; }else{ return false; } } or export const oneWillDo = (x, y, z) => x || y || z;
jomer once again, what's the point of posting correct code? To spoil the learning path for those who are trying to solve tasks on their own?