Created
July 23, 2013 12:33
-
-
Save pbroschwitz/6062028 to your computer and use it in GitHub Desktop.
Contains wrapper method as proposed by JS Drip #28 http://us6.campaign-archive2.com/?u=2cc20705b76fa66ab84a6634f&id=6b53e9c756&e=9d9db64a8f
This file contains hidden or 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 aContainsB (a, b) { | |
return a.indexOf(b) >= 0; | |
} | |
var philosophers = "Aquinas, Maimonedes, and Avicenna"; | |
var me = "Joshua"; | |
function printPhilosopherStatus (person) { | |
if (aContainsB(philosophers, person)) { | |
console.log(person + " is a philosopher."); | |
} else { | |
console.log(person + " is NOT a philosopher."); | |
} | |
} | |
// Outputs: "Joshua is NOT a philosopher." | |
printPhilosopherStatus(me); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment