Programming Examples

Are you a Programmer or Application Developer or a DBA? Take a cup of coffee, sit back and spend few minutes here :)


JavaScript is a Type-less scripting language used windely in the web programming world.

JavaScript 010 – Local & Global Scope

Local Variables in JavaScript

We know that JavaScript is not strict in Type-Checking. In JavaSctipt, a variable can hold an integer and the same variable can even store string later. However, JavaScript supports variable scope and lifetime eventhough they are typeless. The Script writer should know Global Scope and Local Scope of variables and functions along with the lifetime. In this example, we will learn all these.

Continue Reading →

JavaScript 008 – Loops For, While, For…In

JavaScript While Loop Example

All the programming languages supports Loops. Loops run the block of code repeatedly to achieve some goal. For example, let us say you have 1000 students’ height in an array, and you want to calculate average student height. Here, a loop is required to read each student’s height and perform a running count. At the end of the loop, we can calculate the average as we have total height and total number of students. In these JavaScript examples, we will learn the looping techniques.

Continue Reading →