Created
October 10, 2013 01:51
-
-
Save IvanGaravito/6911823 to your computer and use it in GitHub Desktop.
Simple big array example
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
| var bigarray = { | |
| "0000": { reactancia: 1, inductancia: 1 } | |
| , "000": { reactancia: 1, inductancia: 1 } | |
| , "00": { reactancia: 1, inductancia: 1 } | |
| , "0": { reactancia: 1, inductancia: 1 } | |
| , "1": { reactancia: 1, inductancia: 1 } | |
| , "2": { reactancia: 1, inductancia: 1 } | |
| //... | |
| , "30": { reactancia: 1, inductancia: 1 } | |
| , "32": { reactancia: 1, inductancia: 1 } | |
| } | |
| var calibre = process.argv[2] | |
| if (calibre && calibre in bigarray) { | |
| var r = bigarray[calibre].reactancia | |
| , i = bigarray[calibre].inductancia | |
| var f = math.sqrt(r ^ 2 + i ^ 2) | |
| console.log("Resultado es: ", f) | |
| } else { | |
| console.log("Uso: node " + process.argv[1] + " <calibre>") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment