AMI interview question

How does foreach work in javascript?