Created
June 14, 2016 15:34
-
-
Save jfmherokiller/1007ea9fcdc192052bb6b26e8086ea54 to your computer and use it in GitHub Desktop.
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
/** | |
* Created by jfmmeyers on 6/14/16. | |
*/ | |
var macros = {}; | |
var ArrayOfCasesAndCodes = [['case1', 'console.log(\'penis\')']]; | |
macros['createswitch'] = { | |
handler: function (name, ArrayOfCasesAndCodes) { | |
macros[name + '_evalswitch'] = { | |
handler: function (casetocheck) { | |
var index; | |
for (index = 0; index < ArrayOfCasesAndCodes.length; index++) { | |
if (casetocheck == ArrayOfCasesAndCodes[0]) { | |
this.eval(ArrayOfCasesAndCodes[1]); | |
} | |
} | |
} | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment