Javascript doesn’t have foreach statement, but it’s simple to emulate one: <script type="text/javascript"> var arr = [’one’, ‘two’, ‘three’, ‘four’, ‘five’, ‘etc’]; for (var i in arr) { var element = arr[i]; alert(i + ‘: ‘ + element); } </script> It’s actually equivalent of foreach in other languages like PHP. …

“Hello world” is actually very simple program on every programming language and it’s just writting to out stream or document or whatever simple two-words sentence – “Hello world”. There are several ways to write hello world script for browser. Optioin #1: Write in document: <script type="text/javascript"> document.write("Hello World!"); </script> Option …