User:Prahlad balaji/loop.js

for( var i =+ 0; i <= 2; i++ ) { alert( i ); // This loop will trigger three alerts, reading "0, "1", and "2" respectively.	} var items = ["foo", "bar", "baz"]; // First we create an array. for( var i = 0; i <= items.length; i++ ) {	alert( items[i] ); // This will alert each item in the array. } if( true ) {	// Do something. } setTimeout(parseInt, 5000); parseInt("123"); var firstColumn = document.getElementsByClassName("column-a"); var photo = document.getElementById("lead-photo"); addNumbers( a,b ); {	return a + b; } function name {	// Our function code goes here. } alert; confirm; prompt; if( 1 == 2 ) {	alert("If you're seeing this, we have bigger problems than JavaScript.");	// 1 is not equal to 2, so this code will never run. } function double( num ) {	total = num + num;	return total; } var total = 10; var number = double( 20 ); alert( total ); // Alerts 40. var textInput = document.querySelectorAll("input[type='text]");