The correct implementation of `isSuperman` is:
```javascript
function isSuperman(isBird, isPlane){
return !isBird && !isPlane;
}
```
This implementation checks if both `isBird` and `isPlane` are false, indicating that it is not a bird and not a plane, which means it must be Superman.
“It’s a bird! It’s a plane! No, it’s Superman!”
We want to write a function isSuperman that takes in two parameters isBird and isPlane and returns true if it is in fact Superman, and false otherwise.
If it’s not a bird and it’s not a plane, it must be Superman.
Which of the following functions is the correct implementation of isSuperman?
function isSuperman(isBird, isPlane){
return isBird || isPlane;
}
JavaScript
function isSuperman(isBird, isPlane){
return !isBird || !isPlane;
}
JavaScript
function isSuperman(isBird, isPlane){
return !isBird && !isPlane;
}
JavaScript
function isSuperman(isBird, isPlane){
return isBird && isPlane;
}
1 answer