Skip to content

Instantly share code, notes, and snippets.

@craigbutcher
Created May 9, 2016 10:51
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 craigbutcher/24beaceb98f98546183db4ec712efb88 to your computer and use it in GitHub Desktop.
Save craigbutcher/24beaceb98f98546183db4ec712efb88 to your computer and use it in GitHub Desktop.
bpzKxE
<p>Taken from <a href="http://jsfiddle.net/3f9jugtg/1/">JS Fiddle</a> via <a href="http://stackoverflow.com/a/13556204">Stack Overflow</a></p>
<p>thanks</p>
<p id="test"></p>
var x = {"_11":1, "_22": 2, "_55": 3, "_44":4};
var y = {"11":1, "22": 2, "55": 3, "44":4};
var output = '';
output += '<p>With "_" prefix: <p>';
for(var a in x) output += "<p>" + 'x obj: '+x[a] + "</p>";
output += '<p>Without "_" prefix: <p>';
for(var a in y) output += "<p>" + 'y obj: '+y[a] + "</p>";
document.getElementById('test').innerHTML = output;
body {
font: 12px arial;
padding: 10px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment