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).
17:17
Merbin Joe
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
slice() method for array values
17:07
Merbin Joe
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
slice() method for string values
14:34
Merbin Joe
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.
01:54
Merbin Joe
If the condition is true the if statements are executed otherwise the next statement will execute.
Syntax
Flow chart
Example
Example Program:- (Editor)
Editor is Loading...
Output:-
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,
Syntax
if(condition)
{
Statements;
}
Flow chart
Example
if(10<50)
{
alert("Executed");
}
Example Program:- (Editor)
Editor is Loading...
Output:-
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,
17:38
Merbin Joe
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.
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.
17:24
Merbin Joe
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.
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.
16:36
Merbin Joe
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.
In the following example program the do...while execute at least once.
17:25
Merbin Joe
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..
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..
15:28
Merbin Joe
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
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);
}
}
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);
}
}
14:12
Merbin Joe
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.
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.
13:19
Merbin Joe
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
12:15
Merbin Joe
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
23:53
Merbin Joe
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.
17:43
Merbin Joe
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).
If you put a number in inside a double or single quote the javascript is consider it as a string (not number).
16:56
Merbin Joe
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.
16:22
Merbin Joe
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.
Subscribe to:
Posts (Atom)
Labels
- javascript
- JQuery
- javascript Beginner
- materializecss
- HTML
- Tips
- Animation Program
- css
- AngularJS
- blogger
- Application
- Game
- RGraph
- SQL
- Php
- .net
- Other
- Tools
- Article
- Android
- Button
- Software
- puzzle
- asp.net
- Theme
- telerik
- Flash
- Cordova
- Website
- c#
- Java
- College
- Hardware
- Maths
- Physicsjs
- Chrome Extension
- DOS
- Naturals
- SQLite
- xml
- Batch
- CarRace
- Image
- MVC
- Networking
- Typing
- WebView
- Xara 3D