AllInWorld99 provides a reference manual covering many aspects of web programming, including technologies such as HTML, XHTML, CSS, XML, JavaScript, PHP, ASP, SQL,FLASH, jQuery, java, for loop, switch case, if, if else, for...of, for...in, for...each,while loop, blogger tips, blogger meta tag generator, blogger tricks, blogger pagination, client side script, html code editor, javascript editor with instant output, css editor, online html editor, materialize css tutorial, materialize css dropdown list,break, continue statement, label,array, json, get day and month dropdown list using c# code, CSS button,protect cd or pendrive from virus, cordova, android example, html and css to make android app, html code play,telerik show hide column, Transparent image convertor, copy to clipboard using javascript without using any swf file, simple animation using css, SQL etc. AllInWorld99 presents thousands of code examples (accompanied with source code) which can be copied/downloaded independantly. By using the online editor provided,readers can edit the examples and execute the code experimentally.


     concat method is used to join two or more arrary or strings. This method does not change the existing(old) value, but return the joined value(new value).

          Return the selected value from string, we can select the string value by using index. If the specified index value is outof range then it will return the -1.
slice() method for array values
     Return the selected value from array, we can select the array value by using index. If the specified index value is out of range then it will return the -1.
slice() method for string values
     In javascript we can call a function while clicking html elements in three types, they are define in following example.
     In this section we are going to see how to convert the pure html and css code to pdf using itextsharp and itexsharp.xmlworker dll's.
     The Boolean() constructor function takes one parameter to be converted to a boolean value (i.e., true or false). Any valid JavaScript value that is not 0, −0, null, false, NaN, undefined, or an empty string(""), will be converted to true. Below, we create two boolean object values. One true, one false.

     If the condition is true the if statements are executed otherwise the next statement will execute.

Syntax

     if(condition)
     {
        Statements;
     }


Flow chart
if statement flowchart


Example

   if(10<50)
   {
      alert("Executed");
   }



Example Program:- (Editor)


Editor is Loading...

Advertisement




Tags:
if statement in javascript allinworld99, if statement in java allinworld99, if statement in c, if statement in cpp, if flow chart in allinworld99,
     if...else is used to check the condition and if the condition is true the if part statements are executed and if the condition is false the else part statements are executed.

     The if...Then...else statement is fundamental to many programming languages. In Intent language, this statement can appear in several different forms.
     allinworld99 recommended you to learn logical wise concept.

      A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each switch case.

Why For Loops?

1) Like all loops, "for loops" execute blocks of code over and over again.
2) The advantage to a for loop is we know exactly how many times the loop will execute before the loop starts.

     for of loop was introduced in ES6 which allows you to easily iterate over elements of an collection.for of iterates over the values of elements of a collection not the keys. A collection can be an array, set, list, custom collection object etc.

     Earlier to ES6 we had to use for loop or Array’s foreach loop to walk through elements of an collection. ES6 introduced a new way for iteration.

     The following example is help you to read all the value from objects.

     for of loop was introduced in ES6 which allows you to easily iterate over elements of an collection.for of iterates over the values of elements of a collection not the keys. A collection can be an array, set, list, custom collection object etc.

     Earlier to ES6 we had to use for loop or Array’s foreach loop to walkthrough elements of an collection. ES6 introduced a new way for iteration.

     for...in is used to read the value from objects, it can read all the objects or array values one by one. In the following example we are discuss how to read the object value using for...in.

     for...in is used to read the value from objects, it can read all the objects or array values one by one. In the following example we are discuss how to read the array value using for...in.

     The while statement creates a loop that executes a specified statement as long as the test condition evaluates to true. The condition is evaluated before executing the statement.

     The do...while statement creates a loop that executes a specified statement until the test condition evaluates to false. The condition is evaluated after executing the statement, resulting in the specified statement executing at least once.
     In the following example program the do...while execute at least once.
     The break statement totally break the loop, in the following example write a for loop for execute 10 times but when the i value is come 3 the loop will totally terminated.

     In linkedIn every one can add us to group message and who did send any message we will get the notification about that message, it is really feel bad. Because 99% not relevant to us. The following method will help you to leave (remove) from that group.

     In the following example, just I created two text box input for getting the number of column and rows and when you click the generate button the dynamic table will create.

Note:
     If you have any doubt about this example please type comments below, ill help you.
     In the following code can use show your div one by one when clicking on the next or back button, just I wrote the main program. Copy the code and you can change the design.

Example
     In the following example just I used 7  div, you can used more div by the changing the class name like page-1, page-2, page-3, page-4, page-5, page-6, page-7, page-8, page-9, etc..

     continue is used to terminate the current iteration of the loop. If will not terminate the control from the whole loop just terminate the control from the current iteration.

     jQuery two methods for show and hide a div, but in some time we need to do the process from a single button there we can use toggle() method.

     Any identifier can use as label name. We can use a label to identify a loop and use the continue statements to continue the execution.

Example
 label1:
for (a = 0; a < 3; a++) {      //The first for statement is labeled "label1"
   loop2:
   for (b = 0; b < 3; b++) {   //The second for statement is labeled "label2"
      if (a === 1 && b === 1) {
         continue label1;
      }
      alert("a = " + a + ", b = " + b);
   }
}


 
     Any identifier can use as label name. We can use a label to identify a loop and use the break statements to interrupt the execution.

     Regular Expression i modifier is used to find all the match with case-insensitive, that mean will not consider the capital letter and small letter difference.

syntax

     str.replace(/w/i,"#")
     In regular expression g is used for global search. If you not use this g that expression only search and find with the first match. More details shown in the following example.



     str.replace(/s/g,"#");
     The following css code are import from google drive so you can't able to see the .css extension, but when you copy the code from here to your website please don't use that same link, just open the link on your browser and save it to your local or server and use it.

     try catch and finally is used to handle all or some of the error when it occur.

try
This statement is contain the set of code for testing.

catch
This statement is execute if any error occur in try block.

finally
This statement always execute after execute the try or catch statement.

  
     The "use strict" directive is introduce from javascript 1.8.5. This can't able to call statement, but this is a literal expression. This tell the code should be execute in "strict mode".

Supported browser:
     strict mode is only support from  the following version

>IE 9
>Firefox 3
>Chrome 12
>Opera 11

  
     The "use strict" directive is introduce from javascript 1.8.5. This can't able to call statement, but this is a literal expression. This tell the code should be execute in "strict mode".

Supported browser:
     strict mode is only support from  the following version

>IE 9
>Firefox 3
>Chrome 12
>Opera 11

     It is very important to increase your followers, because facebook allow 5000 friends, and if you want reach your facebook post, you need more followers. And if you have more friends facebook might have a chance to ask your friends details on login, if you not enter the correct details your account will be block.

     Concatenation mean adding two string or character, addition mean sum of two number, in the following example is explaining the difference of adding two numbers and adding one number and character.

     If you put a number in inside a double or single quote the javascript is consider it as a string (not number).

     Binary floating point math is like this. In most programming languages, it is based on the IEEE 754 standard. JavaScript uses 64-bit floating point representation, which is the same as Java's double. The crux of the problem is that numbers are represented in this format as a whole number times a power of two; rational numbers (such as 0.1, which is 1/10) whose denominator is not a power of two cannot be exactly represented.


     When you add or multiply floating point number you may face a problem on calculation, the calculation will return the long digit number, like 0.1+0.2 it return wrong value so you can use the following solution.


What can I do to avoid this problem?
     That depends on what kind of calculations you’re doing.
1. If you really need your results to add up exactly, especially when you work with money: use a special decimal datatype.
2. If you just don’t want to see all those extra decimal places: simply format your result rounded to a fixed number of decimal places when displaying it.
3. If you have no decimal datatype available, an alternative is to work with integers, e.g. do money calculations entirely in cents. But this is more work and has some drawbacks.

One type of Solution
     The following solution will help you to solve your problem.

     The following loader only we are using the css code. This can be used for loader on waiting time.

Total Pageviews