Blog


05

May 2016

Type Conversion in JavaScript

Type conversion is a process of converting one type to another, which means number type to string and string type to number. JavaScript have 5 data types- number, string, boolean, object and function. JavaScript defined two ways of type conversion : 1. Conversion using function 2. Automatic conversion. The String() method can convert a number to a string. [/php] OUTPUT : The String() method can...

Read More


05

May 2016

Labels in JavaScript

In JavaScript you can give label names to your statements and this label will used by continue and break statement. Syntax : break labelName; continue labelName; OUTPUT : New Delhi Mumbai Hyderabad


05

May 2016

Continue Statement of JavaScript

The “continue” statement is used to break one repetition(iteration) in the loop, if a specifies condition occurs and continues with next iteration. OUTPUT : The continue statement will skip the step where num = 5


05

May 2016

Break Statement of JavaScript

JavaScripts “Break” statement jumps out from current loop to outer. It breaks the loop and continues to executing of outer loop codes. OUTPUT : “Break” Statement example with for loop


04

May 2016

Do – While Loop in JavaScript

JavaScript do while loop repeats the elements for the infinite number of times like while loop. But this execute code at least once whether condition is true or false. Sysntax : do { code block to be executed; } while (condition); OUTPUT : Click the button to loop through a block of code as long as i is less than 8. See Result


04

May 2016

The While Loop of JavaScript

This loop will execute code as long as a specified condition is true. Syntax while (condition) { code block to be executed } OUTPUT : Click the button to loop through a block of code as long as i is less than 6. Try it


04

May 2016

The For Loop of JavaScript

The For loops used to repeat a block of code a number of times. Syntax for (statement 1; statement 2; statement 3) { code block to be executed; } OUTPUT : Click the button to loop through a block of code ten times. Try it


04

May 2016

Loops in JavaScript

Loops are used to execute a block of code a number of times means to repeat number of times same code (with different values). Types Of Loops : 1. for loop 2. while loop 3. do-while loop. OUTPUT : New Delhi Noida Mumbai Benglore


04

May 2016

Switch Statement in JavaScript

In JavaScript Switch statement is used to perform different tasks/actions based on different conditions. We use the switch statement to select one of many blocks of code to be executed. Syntax switch(expression) { case 1: code block break; case 2: code block break; default: default code block } OUTPUT :


03

May 2016

The else if Statement of JavaScript

We use else if conditional statement to specify a new condition if the first condition is false. Syntax : if (condition1) { Statement one } else if (condition2) { Statement two } else { Statement three } OUTPUT : Click the button to get a greeting: See Result



Page 4 of 28« First...23456...1020...Last »