You are on page 1of 18

WEB APPLICATIONS DEVELOPMENT

JavaScript Parts

Week 6
WEB APPLICATIONS DEVELOPMENT - CIT

Prayer for today


Ama sa Langit, bigyan kami ngayong araw upang matupad ang aming
mga tungkulin bilang responsable at mabait na mag-aaral.
Bigyan kami ng gabay at pangangalaga sa pagtupad ng aming mga
gawain.
Bigyan mo kami ng tulong sa mga desisyon na aming ginagawa.
Nanalangin kami sa iyo na pagpalain ang aming mga guro para sa
matiyagang paghahatid sa amin araw-araw na mga aralin.
Pagpalain ang aming mga magulang sa patuloy na pagsuporta sa amin.
Maraming salamat, Lord sa lahat ng mga biyayang ibinibigay mo sa
aming lahat. Ikaw ang aming suporta at lakas.
Amen.
2
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

Learning Outcomes
1. Understand JavaScript operators and its use.
2. Understand functions, comments and it’s uses.
3. Understand iteration and loops.

3
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
JavaScript Operators
WEB APPLICATIONS DEVELOPMENT - CIT

JavaScript Operators

5
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

Arithmetic Operators
Arithmetic Operators perform arithmetic on numbers (literals and variables)

6
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

Assignment Operators
Assignment Operators assign values to JavaScript variables. You can
use const, let and var for assigning a value to variable.

7
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

Logical Operators
Logical operators are used to determine the logic between variables or
values. (AND, OR, NOT)

8
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
JavaScript Functions
WEB APPLICATIONS DEVELOPMENT - CIT

JavaScript Function
A JavaScript function is a block of code designed to perform a particular
task.
A JavaScript function is executed when “something” invokes it (calls it).

10
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

JavaScript Function Syntax


- A JavaScript function is defined with the function keyword, followed by
a name, followed by parentheses ().
- Function name can contain letters, digits, underscores and dollar signs.
- The parentheses may include parameter names separated by
commas: (parameter1, parameter2, …)

11
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

Why functions?

- You can reuse code: Define the code once, and used it many
times.
- You can use the same code many times with different
parameters to produce results.

12
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

Why functions?

- You can reuse code: Define the code once, and used it many
times.
- You can use the same code many times with different
parameters to produce results.

13
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
JavaScript Comments
WEB APPLICATIONS DEVELOPMENT - CIT

JavaScript Comments
- JavaScript comments can be used to explain the JavaScript code,
and make it more readable.

Single Line Comments


- Single line comments starts with //

15
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
WEB APPLICATIONS DEVELOPMENT - CIT

Multi-line Comments
- Multi line comment starts with /* and it ends with */

16
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN
JavaScript Loops
WEB APPLICATIONS DEVELOPMENT - CIT

JavaScript For Loop


- Loops can execute a block of code a number of times.
- Loops are handy, if you want to run the same code over and over
again, each time with a different value.

18
SYSTEMS PLUS COMPUTER COLLEGE - CALOOCAN

You might also like