Category: JavaScript

JS Events

JavaScript Events JavaScript Events A JavaScript function is a section of code that perform a specific task when called. Calling a function is achieved by its name. Syntax: function function_name() { function code } Example: <html> <head> <script> function helloFunction() {...

JS Functions

JavaScript Functions JavaScript Functions A JavaScript function is a section of code that perform a specific task when called. Calling a function is achieved by its name. Syntax: function function_name() { function code } Example: <html> <head> <script> function helloFunction() {...

JS While Loop Statement

JavaScript While Loop Statement JavaScript While Loop Statement While Loop statement is a repetitive statement which is executed after evaluating the condition. If the resulting value is true the the execution is repetead until becomes false. Syntax: while (condition){ If condition...

JS For Loop Statement

JavaScript For Loop Statement JavaScript For Loop Statement For Loop statement – is a loop statement that evaluates the expression. If it meets the condition of initialization then increment the value of initialization and repeat execution steps until no longer meets...

JS Switch Case Statement

JavaScript Switch Case Statement JavaScript Switch Case Statement Switch Case statement is used when we have to chose between several individual cases after the evaluation of an expression. Syntax: switch (expression) { case v_1: statement_1; break; case v_2: statement_2; break; case...