Created
January 30, 2017 17:57
-
-
Save samueljoli/d0af87ff77ec4193c3172bb59527baa0 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
//javascript... NOT assembler... that would take too long: | |
var jumpAddressTable = new Array; | |
jumpAddressTable[0] = function (){ console.log('I like 0')}; | |
jumpAddressTable[1] = function (){ console.log('This is an arbitrary function')}; | |
jumpAddressTable[2] = function (){ console.log('2 is the smallest non-negative prime number')}; | |
jumpAddressTable[3] = function (){ console.log('One more for the show')}; | |
var switchVal = 2; | |
jumpAddressTable[switchVal](); | |
//would print '2 is the smallest non-negative prime number' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment