JavaScript is a client browser based scripting language to perform actions within a person's browser. JavaScript is specifically used for web development. JavaScript was designed to look like Java, but is weakly typed.
The JavaScript function setTimeout and setInterval performs an action after a specified time period. The difference between setTimeout and setInterval is that setTimeout performs an action only once once after the specifed time period ellapses, and setInterval keeps repeating the action. The actions started by setTimeout and setInterval can be stopped by using the methods clearTimeout and clearInterval respectively.
JavaScript clock demonstrates how to build a digital automated clock using JavaScript. JavaScript clock uses the JavaScript Date() object to determine the current time. The JavaScript method setInterval is used to automate the JavaScript clock.
JavaScript slide fade marquee is a JavaScript script that makes specified text scroll from right to left, stopping as soon as it hits the side, and making the text fade from one color to another at the same time.
A JavaScript for loop is used when you know how many times a piece of code should execute. In a JavaScript for loop you normally know the number of iterations in advance.
Currently the JavaScript language does not have a JavaScript trim function for string variables. Programmatically the behaviour of JavaScript trim can be emulated by using regular expressions. Although some sort of loop can also be used, where leading and trailing spaces are removed from the string variable, the use of regular expressions to implement a JavaScript trim function is much more efficient.
JavaScript preload images are loading an image into the cache of the browser, even before the image is needed. JavaScript preload images come in handy when creating mouseover effects with images. When doing the mouseover, the image should be immediately available. JavaScript preload images remove any delay in waiting for images to load when doing a mouseover with images.