[X]

Javascript Conditional Statements - (Learning Javascript Series)

Javascript Conditional Statements

There are two conditional statements in JavaScript: if and switch. The if statement allows the program to choose one of two alternatives, based on some predefined factor.

If statement: It is used to interrupt program flow for some condition.

var num = 10;
                if (num < 20) {
                    alert(num + " is less than 20.");
                }

If - Else: It is used to interupt program flow for some condition but instead of satisfying for one, it will also check for second condition.

var num = 10;
                if (num < 20) {
                    alert(num + " is less than 20.");
                }
                else {
                    alert(num + " is greater than 20.");
                }

More...

Javascript Fundamentals - (Learning Javascript Series)

Javascript fundamentals

Let us learn the fundamental of javascript. This includes knowing the common programming terms related to javascript and also how to work with them.

Some of the most common terms are:

Statement: One line of programming code; statements are often separated by semicolons (;) in JavaScript.

Variable: A named location for storing values that can be changed during program execution.

Constant: A named location for storing values that cannot be changed during program execution.

Function: A named set of statements that perform some operation and can optionally return a single value.

Keyword: A word that has a predefined meaning in JavaScript, and cannot be used for any other purpose.

Operator: Typically a symbol (such as +, -, *, or / ) that takes one or more values (called operands) and returns a result.

Expression: A combination of keywords, operators, variables, and/or functions from which a result can be calculated.

String: A sequence of 0 or more letters, numbers, or other text characters; strings are typically enclosed in quotation marks, as in “Hello World!”.

Boolean: A value or expression that evaluates to either true or false.

Literal: A Boolean, number or string that is written directly in the code. For example the expression 22/7*radius*radius contains 2 number literals.

Value: A number, Boolean, string or object.

More...

Posts By Month