Integrative Programming
ction to Java
du sc
ro ri
t p
In t
The basic things you need to know about Javascript
me!
o
c
le
W
Thank you for joining me in this
very important discussion about
the basic of Javascript.
Before...
HTML websites have no functions
When a website needs a piece of data that you
searched for, or converting between different
units. The website:
1) request this information in the data center
where all the business logic resides
2) data center then returns the data back to
the website
the differe
ot nc
Sp e
HTML CSS Javascript
Consider this as Consider this as Consider this as motion of
the skin or color of the body the body like dancing,
the structure of the body
walking and etc.
Did you know?
In the beginning there was MOSAIC
web browser...
Javascript was originally designed as a
scripting language for NetScape Navigator.
There was a war between Internet Explorer
and Mosaic. Mosaic died. But of its
technologies, were in Mozilla Firefox.
lET'S DEFINE.
WHAT IS JAVASCRIPT?
THE TOP 1 PROGRAMMING
LANGUAGE
JavaScript is a prototype-based scripting
language with dynamic typing and first-
class functions.
Originally designed for the browser. But now
used literally everywhere.
The Who?
It was created in 1995 by Brenden Eich
Just 10 days development?
Yes, the first version of this scripting language was
only 10 DAYS.
Who created formal standards?
Who created
Netscape goes to ECMA for getting standards. First
formal standards released in 1999 as ECMAScript 3-
Javascript?
Has been stable ever since.
What is the SYNTAX?
Always remember the semi colon ;)
Data Types
Numbers
Double-precision 64-bit format [ Int and
floats]
- Leads to problems this 0.1 + 0.2 ==
0.30000000000000004
- All standard arithmetic operators ( + , - , * , /
,%)
- Math Object , Math.sin() , Math.round() ,
Math.floor() etc
- parseInt() , parseFloat() for parsing string to
numbers
- Special Numbers - NaN , Infinity
Data Types
Strings
-Sequences of 16 bit Unicode chars . It will
support any language
-String has a lot of built in functions,
properties
Data Types
Boolean
-Coerce any thing into Boolean using
Boolean()
- Falsy Values :false, 0, “”,NaN, null, and
undefined
- Truthy Values: Everything else
Object
- Most important part of JS .Everything is an
object in JS . Even Functions
- Simple collections of name-value pairs
- Primitives are immutable
Object
Function
All functions will have access to special
parameters inside its body like arguments ,
this etc.
Flow Control
What are the JS flow control
structures?
Flow Control Structures
If then else
while
for
ternary operator
switch case
for in
break
continue
We did not do anything?
Time for a
challenge!
Please complete the succeeding tasks. Once
completed kindly submit it in Edmodo.
Javascript Exercises
Getting Started
Using Mozilla Firefox, go to Settings >
Web Developer > Web Console.
You should be able to see this interface.
See screenshot.
Follow this
video:https://www.loom.com/share/c9e9af120f29
42f3a686a34a4bf151ce
Once done, submit your video link to
Edomodo - https://new.edmodo.com/groups/3r1-
integrative-programming-37176898
Javascript Exercises
Variable Exercise
Given the existing code on the right side, can
you write some code so that their values are
switched around?
The output should be:
a is 8
b is 3
Rules:
1) Do NOT change any of the existing code.
2) You are NOT allowed to type any numbers.
3) You should NOT redeclare the variables a
and b.
alk!
t
s
't
eL
EMAIL ADDRESS
[email protected]
MESSENGER
https://www.facebook.co
m/anna.edulsa/
CONSULTATION HOURS
3 PM to 6 PM, Tuesday and
Thursday
Reach out if you have comments,
questions, and more