















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















Learning Outcomes: At the end of the session, the students should be able to:
4 Variables
5 Strings What are strings? Example: strTest = “Welcome to QCU”; The new Keyword Example: strTest = new String(“Welcome to QCU”); String Concatenation Example 1:
Example 2: strTest += “.”; JAVASCRIPT
7 Expressions and Operators Examples:
8 Arrays What are arrays? Special variables which can hold more than one value at a time and is treated as a single unit Creating Arrays Example 1: var score = new Array(); score [0] = 39; score [1] = 40; score [2] = 100; score [3] = 49; JAVASCRIPT
10 Conditional Statements
var x = 10; If (x == 10) window.alert(“The number is 10!”);
(x == 10) (y < z) Looping Structures Types of Loops
Variable w/ Initial Value Condition Counter Increment/ Decrement JAVASCRIPT
11
JAVASCRIPT
13
Example: var person = new Object(); person.firstname="John"; person.lastname="Doe"; person.age=26; person.eyecolor="brown";
Accessing Object Properties Example:
String Objects Example:
Built-In Objects JAVASCRIPT
14 Regular Expressions
var regexPatt = new RegExp(pattern, modifiers); or simply: var regexPatt = /pattern/modifiers;
16 Pattern Matching String Methods for Regular Expressions:
JAVASCRIPT
17 The RegExp Object
19
Common Input Type Values:
20 Client-Side JavaScript Common Components: