Skip to content

Instantly share code, notes, and snippets.

@ossareh
Created December 2, 2010 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ossareh/725930 to your computer and use it in GitHub Desktop.
Save ossareh/725930 to your computer and use it in GitHub Desktop.
underscore
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<script>
var obj = {"NUM_T1":"581","CABS":{"NYKFP02-CABW1":{"VOLTAGE":54.51,"CURRENT":18.27},"NYKFP02-CABW2":{"VOLTAGE":54.65,"CURRENT":16.85}}}
_.each(obj.CABS, function(v, k) {
console.log("cab '" + k + "' has voltage: " + v.VOLTAGE) ;
}) ;
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment