Write a JavaScript program to display HTML heading in different colors.
<html>
<head>
<title>Display Heading in Different Colors</title>
</head>
<body>
<script>
var colors = ['red', 'blue', 'cyan', 'yellow', 'brown'];
var i;
for(i = 0; i < colors.length; i++)
{
document.write("<h1 style=\"color:" + colors[i] + "\";>Hello</h1>");
}
</script>
</body>
</html>
