I need to see output as cat,dog,fish,bird what syntax I suppose to use.

<script>
a1=cat;
a2=dog;
a3=fish;
a4=bird;
for (var i = 1;i <= 4; i++){
document.writeln(ai);
}
</script>