Skip to content

Instantly share code, notes, and snippets.

@dvdrtrgn
Last active January 29, 2018 17:55
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 dvdrtrgn/460db3c214ade506fe7123500b1b4c8c to your computer and use it in GitHub Desktop.
Save dvdrtrgn/460db3c214ade506fe7123500b1b4c8c to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
document.body.innerText = '';
function domlog(x) {
document.body.innerText += JSON.stringify(x) + '\n';
}
function lineate(obj){
var arr = [], i;
for (i in obj) arr.push([i, obj[i]].join(':'));
domlog(arr);
}
var obj = { a:1, b:2, c:3, '123':'xyz' };
/* log1 */ lineate(obj);
obj.a = 4;
/* log2 */ lineate(obj);
delete obj.a;
obj.a = 4;
/* log3 */ lineate(obj);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment