<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript for in object</title>
</head>
<body>
<pre> <!-- Use pre element for work document.writeln() method -->
<script>
var obj = {'a': 'AAA','b': 'BBB','c' : 'CCC'};
for (var key in obj) {
document.writeln(key +" : "+ obj[key]);
}
</script>
</pre>
</body>
</html>