Skip to content

Instantly share code, notes, and snippets.

@JesterXL
Created May 22, 2015 13:23
Show Gist options
  • Save JesterXL/29a678c50929a6e79805 to your computer and use it in GitHub Desktop.
Save JesterXL/29a678c50929a6e79805 to your computer and use it in GitHub Desktop.
Why Boolean doesn't work as a checked value
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