For And While Loop

7
Web Design & Development Batch-02 HACKERS :- Group:-

Transcript of For And While Loop

Web Design & Development Batch-02

Web Design & Development Batch-02 HACKERS :-Group:-

NAMEIDSHUVO MALAKARBB-TMSS-070216SYL46MD.JABED MIAHBB-TMSS-070216SYL47MD.MUHIT MIAHBB-TMSS-070216SYL48

Group Members

JavaScriptJavaScript resides inside HTML documents, and can provide levels of interactivity to web pages that are not achievable with simple HTML. Key differences between Java and JavaScript: Java is an OOP programming language while Java Script is an OOP scripting language.

EstablishmentJavaScript was created in 10th May 1995 by Brendan Eich, then working at Netscape and now of Mozilla. JavaScript was not always known as JavaScript: the original name was Mocha, a name chosen by Marc Andreessen, founder of Netscape. In September of 1995 the name was changed to LiveScript, then in December of the same year, upon receiving a trademark license from Sun, the name JavaScript was adopted.

Lets now discuss about -----------------For & While Loop--------The Loops are used when the users repeat some statement in a program.

For Loop:The For loop is usually used when you need to repeat a given number of times.

var text = "";var i;for (i = 0; i < 5; i++) { text += "The number is " + i + "
";}document.getElementById("demo").innerHTML = text;

The number is 0The number is 1The number is 2The number is 3The number is 4

While LoopThe while loop is usually used to repeat something until a given condition is true.

var text = "";var i = 0;while (i < 10) { text += "
The number is " + i; I++;}document.getElementById("demo").innerHTML = text;

The number is 0The number is 1The number is 2The number is 3The number is 4The number is 5The number is 6The number is 7The number is 8The number is 9

Thanks A LotFor Being With US