Tuesday, 1 March 2016

Expression And Statement In JavaScript

Posted by Ashutosh Dwivedi -Digital Marketer on Tuesday, March 01, 2016 | No comments
Expressions are phrases that make a worth. JavaScript code is completed more often than not of expressions in various forms.
 Statements are phrase that don’t generate a worth but as an alternative have some class of side-effect. Examples of side-effects consist of storing variables in recollection and jumping to a unlike part of the script. Statements often merge keywords such as variables (var) if or while with one or more expressions so that the side-effects have standards to effort through. Firebug makes it easy to distinguish among expressions and statements. When you enter an expression, it outputs the resulting value:
1 + 2; 3
When you go through a statement, Firebug doesn’t illustrate you any output, still if the statement includes a few expressions. That’s why I have to use console.log () in not many of my examples. This if statement doesn’t produce a value. Instead, it controls whether to evaluate the block (the code in curly braces).
if (true)
 {
console.log("expression");

}

0 comments:

Post a Comment