Print Design Templates Take a look at these creative Graphic Design templates for brochures, flyers, newsletters, stationery, postcards, ads, menus and posters for a variety of businesses.
Invoicing 4 Freelancers A complete, secure, online billing application that maintains hourly service billing, flat fee billing and recurring charges. Integration with Authorize.Net and other leading payment gateways provides hands-free recurring billing with a sophisticated CRM system.
Free Design Magazines Browse through our extensive list of free Graphic Design, Web Design, Business, Computer, and Computer Graphics magazines, white papers, downloads and podcasts to find the titles that best match your skills and interests; topics include management, marketing, operations, sales, and technology. Simply complete the application form and submit it. All are absolutely free to freelance professionals who qualify.
Suggested Links Photoshop Tutorials
Logo Designer's Logos
Web Design Tools List
Layouts & Templates Directory
Web Design & Graphic Design Blog
Photoshop, Flash, 3D Studio Max Tutorials
Web Designers & Developers
Crafts for Kids
Photoshop Tutorial Man
Tutorial Guide -- Free Webmaster Tutorials
Design Contests
How to Draw
Work From Home Job Search
OTHER SITES WE OWN
AllFreelance
Graphic Design Resources Directory
Graphics Tutorials Directory
Social Networking Articles
Design Sites Up
All Freelance Work & Portfolios
Graphic Design Community
Education & Learning Directory
![]() |
home > Web Design Tutorials > Programming Tutorials > Javascripting Articles > Javascript Arrays & Loops Statements Coding Tutorials
JavaScript Control Statements
In this tutorial you learn The If Statement, The While Statement, The For Statement, The switch statement….
JavaScript Array Object
In this tutorial you learn JavaScript Array Object…
Control structures
See syntax of The If … else, The Conditional Operator, The While loop, The Do ... While, The For loop, The For ... in loop and The Switch statement .
Data structures
A typical data structure is the Array, which is a map from integers to values. In JavaScript, all objects can map from integers to values, but Arrays are a special type of object that has extra behavior and methods specializing in integer indices (e.g., j
JavaScript Loops
Loops in JavaScript are used to execute the same block of code a specified number of times or while a specified condition is true.
![]() |
![]() |
![]() |
||
![]() |
![]() |
![]() |
||
For loop Example
How to write a for loop. Use a For loop to run the same block of code a specified number of times.
Looping through HTML headers Example
How to use the for loop to loop through the different HTML headers.
Javascript Arrays & Loops Tutorials - While loop Example
How to write a while loop. Use a while loop to run the same block of code while a specified condition is true.
Do while loop Example
How to write a do...while loop. Use a do...while loop to run the same block of code while a specified condition is true. This loop will always be executed once, even if the condition is false, because the statements are executed before the condition is te
JavaScript Break and Continue
There are two special statements that can be used inside loops: break and continue.
Break statement Example
Use the break statement to break the loop.
Continue statement Example
Use the continue statement to break the current loop and continue with the next value.
JavaScript Array Object
The Array object is used to store a set of values in a single variable name.
Create an array Example
Create an array, assign values to it, and write the values to the output.
Join two arrays: concat() Example
How to use the concat() method to join two arrays.
Put array elements into a string: join() Example
How to use the join() method to put all the elements of an array into a string.
Literal array: sort() Example
How to use the sort() method to sort a literal array.
Javascript Arrays & Loops Tutorials - Numeric array: sort() Example
How to use the sort() method to sort a numeric array.
JavaScript Arrays
Arrays are one way of keeping a program more organized. They allow you to do some things that are difficult without them. Arrays are usually a group of the same variable type that use an index number to distinguish them from each other.
JavaScript Associative Arrays
Associative arrays give you another way to store information. Using associative arrays, you can call the array element you need using a string rather than a number, which is often easier to remember. The downside is that these aren't as useful in a loop b
Loops, Versions, navigator Object
A repeat loop cycles though a group of statements until some condition is met. For instance, you can use a repeat loop to cycle though an array and print it to the screen. Or, you might want to cycle though the Array and look for some specific information
JavaScript Programming, Arrays
The use of an array is a fundamental programming concept in virtually all programming languages, although the actual implementation differs greatly among languages…
JavaScript Programming, Functions Revisited
Functions, or procedures as they are called in some languages, provide a fundamental building block for virtually every programming language. The purpose of a function is to encapsulate the ability to perform a given task into a single set of code and to
Two-dimensional Arrays in JavaScript
The following example shows you how a two-dimensional array can be produced in JavaScript.
Arrays and HTML Code
The file which does all the work in this slide show is slide-showNavigator.htm. To move pages around, we must first catch our pages ... and in this case we catch them in an array. We use two arrays: One to hold the URLs and another to hold the description
'For' Loops
In general, you use For loops when you know how many times you want to perform a loop. Use While loops when you are not sure how many times you want to perform a loop. In this example we will look at a For loop.
'While' Loops
This example looks at the While loop. Remember that usually you use For loops when you know how many times you want to perform a loop and While loops when you are not sure how many times you want to perform a loop. This sample will break the rule! We're d
LOOPS
Imagine that you wanted a script to perform the same routine over and over again 50 times in a row…
ARRAYS
When working with more complex scripts you might face a situation in which you would have many more or less similar variables...
Counting and Looping
Some of the assignments the browser will need to perform on your code consist of executing a portion of code over and over again until an intermediate condition occurs.
Introduction to Loops
Sometimes you want to do the same thing more than once. Let's say, for example, that you wanted to get a password from somebody and you wanted to keep asking until they gave you the right password. If you just wanted to give them two tries, you could do s
Looping Password
Here we define the password as a string, and we declare a variable called answer. You'll see why we had to declare answer in a second. The next few lines are the important ones…
More about While Loops
Learn a good tutorial of While Loop in javascript.
For Loops
Learn a good tutorial of For Loop in javascript.
Nested Loops
In this tutorial you learn a Loop with in a Loops (Nested Loops)…
Arrays
Arrays are lists. You might have a list of URLs that you want to visit, a list of names that you want to remember, or a list of colors in which you'd like text displayed. All these lists can be stored in arrays.
Arrays and Loops
Arrays are great, because you can loop through each element of the array and do something with it.
Arrays in the Document Object Model
This example is going to use image swapping to show how arrays are woven into the DOM…
Loops
Loops are used to repeat a process or section of code a specified number of times. There are three types of loop statements: for, while, and do while.
Nested Loops
You can also nest for statements to obtain greater control and add a variety of tasks. Try this one and see what happens…
The while statement
A while statement is good for short comparisons. It will continue to repeat until the comparison is false. Unlike the for statement, it does not create its own variable. It must use an existing one from the main script…
JavaScript Loops
JavaScript performs several types of repetitive operations, called ``looping''…
The JavaScript Array
A JavaScript array is a beautiful thing. It is a little database holding any given type of information, and is easily accessible to you and your scripts.
The JavaScript Array: Dense, Parallel and Multidimensional
In the construction of a dense array, the array constructor and all the array's elements are contained on one line…
Select Menus: The Options Array and SelectedIndex Property
In this example, we are using parallel arrays to power an HTML select menu for navigation. The simple HTML menu and its code is as follows…
Images Array
Every HTML document is considered by the JavaScript engine to have an images array, whether it contains one image, many images or even no images.
The For Loop and The Break Keyword
Using for loops, we've shortened the long arrays from 24 or 60 lines each to 4 lines each. Our time script has been shortened by about 140 lines…
Looping Through the Forms and Elements Array
Accessing forms and form elements in JavaScript can be accomplished several different ways…
Looping through Radio Buttons / The Checked Property
In order to find which radio button within a group has been checked, you must loop through the entire group.
Understanding JavaScript for Loop
The main strength of any programming language is its ability to process blocks of code repeatedly. Computers are especially adept at perfoming repeated calculations. JavaScript, like other programming languages, provides us with loop.
JavaScript While Loop
The while loop is much simpler than the for loop. It consists of a condition and the statement block.
JavaScript break And continue Statements For Loops
JavaScript provides commands through which iterations of a loop can be skipped or stopped. These commands are most commonly used along with an if statement inside the loop.
JavaScript Arrays: creating and storing values
An array can be regarded as a set of variables. This does not mean that the variables in an array are related to each other; they are still separate entities in themselves…
JavaScript arrays
Arrays in JavaScript are incredibly flexible. The first element in an array has the index 0, and the length of an array is handled automatically. You can place elements at any index in an array at any time.
Arrays
Arrays in JavaScript are extremely useful for storing and manipulating information you have coded directly into the script, or information collected from the browser. In this article, Dan Wellman details how to use and manipulate them.
Multidimensioned Arrays
In the same way that arrays contain integers or strings as values, multidimensional arrays contain arrays as their values. The syntax for a multidimensional array is as follows…
JavaScript Arrays: Beginning Code
Begin by adding the following block of code to your text editor…
JavaScript Arrays: Associating Images and Links
The question now is, how do we ensure that each image is associated with the correct link? Simple, we use another set of arrays to hold each of the links…
The Array-object
Arrays are very important. Just think of an example where you want to store 100 different names…
Javascript Arrays & Loops Tutorials - Loops
A loop is a repeated execution of a series of steps as long asa agiven ccondition is satisfied…
Arrays
You'll learn to process JavaScript arrays of any nesting level from this lesson.
Javascript Loops
This tutorial descibes the creation of JavaScript loops, that can be executed either certain number of times or till the required result is reached.
Iteration
Some statements in JavaScript are known as iterative statements. These statements have control structures that delimit them and which determine how many times (zero or more) the delimited code is executed, based on some condition…
Exiting Loops
Sometimes you want to break out of a control statement early, perhaps because of an error or some other condition that the conditional expression itself is not testing for. We have seen an example of this already with the break statement used in a switch
Defining Arrays
An array is a composite data type that stores a collection of values. These values can then be referenced by an index number…
Working with Arrays
You access elements of the array by using the array name followed by square brackets, aName[iNum]. The square brackets contain the number of the array element to be referenced…
Javascript Arrays & Loops Tutorials - Array Methods
Since arrays and object are in many ways interchangeable in JavaScript, it would follows that arrays have methods, just as objects do.
Array Object
There are three ways of defining an array…
Understanding and implementing arrays
So what are arrays? Well, they are an alternative way of defining variables that allow multiple variables to be quickly declared, painlessly…
The "for" loop
The "for" loop is a JavaScript "method" that allows a certain action (ie: block of code) to be performed continuously in a variably controlled fashion.
Arrays
The Array class is one of the predefined classes available in Javascript and the first that we have come to that requires the class from which the object is to be derived be included in its definition rather than being assumed based on the value that is a
Javascript Arrays & Loops Tutorials - FOR Loops
So far we have looked at statements that are run in sequence or where a selection is made as to which of several statements is to be run…
WHILE Loops
Even easier to use than the for loop is the while loop. A while loop doesn't initialize or increment any fields automatically as part of the command, it just tests a condition and executes the loop for as long as the condition remains true.
STATEMENT: For
The for statement creates a loop consisting of three optional expressions enclosed in brackets and separated by semicolons, and a block of statements to be executed…
OBJECT: Array
An array is an ordered set of values grouped together under a single variable name created by using an Array object constructor…
JavaScript Arrays
Arrays are variables, which can contain multiple values. The difference is that it is only “one” array, which will store these values. If you needed to store multiple values in normal variables, then you would have to define multiple variables…
JavaScript Array Object Functions
The Array object contains 10 functions. In this section you will see these 10 functions in some small examples. Please refer to the array object, if you need more details about it. All functions are used with the array object…
JavaScript Loops
Loops can be used to repeat something again and again till a condition returns false or true depending on how you need it. Lets imagine a loop in a real life…
RECENT ARTICLES from Graphic Design BloG
[CaRP] Can't open cache file.
Business Cards: Ideas and Inspiration, Part II
Today we continue looking at business cards that stand out, and here’s hoping you get some inspiration and ideas! After all, you only get one first impression, so your business card should be something that showcases the best of your design abilities. On Wednesday we looked at the use of interesting shapes, 3D business cards, [...]
![]() |
![]() |
|
![]() |
![]() |
|
[CaRP] Can't open cache file.
Making the Move from Freelance Work to Full-Time Employment
If you are like me, after graduating from a graphic design school, your goal was to make it as a freelance web designer. The lure of flexible hours, working from home and the freedom to manage your own time was too much to resist. At some point, I decided it may be ?easier? to work [...]
Tips for Asking for a Raise
At some point in our careers, there is a time when we open our paychecks and breathe a sigh of disappointment. After years of studying at a graphic design school and countless hours spent devoted to learning from colleagues and researching new design techniques, the numbers on our pay stub just don?t seem to measure [...]
Stock vs. Original Digital Photography
A picture is worth a thousand words. Graphic design schools teach us that photos on web sites have the potential to capture our attention, motivate us to read more or even propel us to navigate to another web site entirely. They inflict emotion and can establish a connection between site visitors and the goods or [...]
3 Tips to Manage Content Updates
While walking through the pharmacy I passed the aisle filled with red heart-shaped boxes filled with chocolates and remembered Valentine?s Day is quickly approaching. Even though I was surrounded by so many representations of love, it reminded me of one thing that I actually despise ? web content updates! Graphic design schools teach many, many [...]
Should You Drop the Drop-Down Menus?
I was recently on a home improvement web site searching for ideas for renovating my bathroom. After a few minutes on the site I realized that I was not going to find what I was looking for ? it certainly could have been there, but I just could not find it. Menu after menu had me [...]
Sharpen Your Skills and Gain an Edge at 2011 Web Design Conferences
Graphic design schools prepare us well for our immediate future, but it takes effort to stay on top of the ever-changing field of web design. Following are a few of the upcoming conferences and trade shows meant to help you stay a step ahead of the competition.
Interaction Eleven In its fourth year, Interaction Eleven is [...]
All Web Design Resources is a Directory & Blog Full of Tools for Web Site Designers
All Web Design Resources Portal is a Web Site Design education directory with resources & articles for Graphic Designers, Web Developers, & Web Designers including a Web Design forum, blog, graphics software tips, web development resources, web programming tools, web design jobs, advice for new web designers about web design schools and education as
well as tips for freelance web design business owners, and much more.