Created
May 22, 2015 13:23
-
-
Save JesterXL/29a678c50929a6e79805 to your computer and use it in GitHub Desktop.
Why Boolean doesn't work as a checked value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getPlayer() | |
{ | |
return { | |
isWorthy: true | |
} | |
} | |
function determineIfWorthy(player) | |
{ | |
return player.isWorthy(); | |
} | |
var players = [getPlayer(), getPlayer(), getPlayer()]; | |
console.log(players.map(determineIfWorthy)); | |
// Uncaught TypeError: player.isWorthy is not a function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment