Intro to JavaScript
September 2017
WIFI: The Department Guest
http://bit.ly/phx-intro-js
1
Your host - Thinkful
Thinkful is an online coding bootcamp for Web
Development and Data Science. What sets us apart from
the others is our support; 1x1 mentorship, live instruction,
and, of course, our JOB-PLACEMENT GUARANTEEJOB-PLACEMENT GUARANTEE.
2
Instructor
Sean Jun
Software Developer, Intel
Thinkful Grad
TA
Shannon Gallagher
Thinkful Community Manager
Beginning coder!
3
About you
What's your name?
What brought you here today?
What is your programming experience?
4
Suggestions for learning
Don't get discouraged, struggle leads to masterystruggle leads to mastery
Don't be shy, take full advantage of our supporttake full advantage of our support
5
Agenda
Learn key JavaScript concepts (20 min)
Go over assignments (10 min)
Complete assignments with our support! (30 min)
Go over answer key (10 min)
Steps to continue learning (10 min)
6
How the web works
Type a URL from a client (e.g. google.com)​
Browser sends an HTTP request asking for specific files
Browser receives those files and renders them as a website
7
Client/Servers
Client (sends requests)
Frontend Developer
Manages what user sees
Server (sends response)
Backend Developer
Manages what app does
8
Example: facebook.com
Client Server
Open browser
and navigate to
facebook.com
HTML, CSS, &
JavaScript render
newsfeed
Request
Response
Algorithm
determines
content of feed.
Sends back
HTML, CSS,
JavaScript files
Application LogicApplication Logic
Initial requestInitial request
Following responseFollowing response
9
Example: facebook.com
Client Server
Open browser
and navigate to
facebook.com
HTML, CSS, &
JavaScript render
newsfeed
Request
Response
Algorithm
determines
content of feed.
Sends back
HTML, CSS,
JavaScript files
Application LogicApplication Logic
Initial requestInitial request
Following responseFollowing response
We'll be writing JavaScript, the code
that the browser uses to run the app
10
History of JavaScript
Written by Brendan Eich in 1995 for Netscape
Initial version written in 10 days
Completely unrelated to Java, but may be named after it to
draft off its popularity
Over 10 years, became default programming language for
browsers
11
Defining a variable with JavaScript
var numberOfSheep = 20
Initialize variable
Name of variable
Value of variable
12
Variable examples
13
Declaring a function with JavaScript
function greet() {
return "Hello world!";
}
Initialize function Name of function
What the function does
14
Function examples
15
If/Else Statements
go to gas stationkeep driving
if false if true
need gas?
family roadtrip
16
If/Else Statements
function familyRoadtrip() {
if (needGas == true) {
getGas();
}
else {
keepDriving();
}
}
17
Comparing Values
== (equal to)
5 == 5 --> true
5 == 6 --> false
!= (not equal to)
5 != 5 --> false
5 != 6 --> true
18
If/Else Statements and Comparing Values
19
Parameters within functions
function adder(a, b) {
return a + b;
}
adder(1,2);
Parameters in declaration
Parameters used
within the function
20
Examples of parameters within functions
21
Real developers use Google... a lot
22
Repl.it setup & first steps!
http://bit.ly/tf-intro-js-challenges
23
24
25
26
27
28

Ijsphx927

  • 1.
    Intro to JavaScript September2017 WIFI: The Department Guest http://bit.ly/phx-intro-js 1
  • 2.
    Your host -Thinkful Thinkful is an online coding bootcamp for Web Development and Data Science. What sets us apart from the others is our support; 1x1 mentorship, live instruction, and, of course, our JOB-PLACEMENT GUARANTEEJOB-PLACEMENT GUARANTEE. 2
  • 3.
    Instructor Sean Jun Software Developer,Intel Thinkful Grad TA Shannon Gallagher Thinkful Community Manager Beginning coder! 3
  • 4.
    About you What's yourname? What brought you here today? What is your programming experience? 4
  • 5.
    Suggestions for learning Don'tget discouraged, struggle leads to masterystruggle leads to mastery Don't be shy, take full advantage of our supporttake full advantage of our support 5
  • 6.
    Agenda Learn key JavaScriptconcepts (20 min) Go over assignments (10 min) Complete assignments with our support! (30 min) Go over answer key (10 min) Steps to continue learning (10 min) 6
  • 7.
    How the webworks Type a URL from a client (e.g. google.com)​ Browser sends an HTTP request asking for specific files Browser receives those files and renders them as a website 7
  • 8.
    Client/Servers Client (sends requests) FrontendDeveloper Manages what user sees Server (sends response) Backend Developer Manages what app does 8
  • 9.
    Example: facebook.com Client Server Openbrowser and navigate to facebook.com HTML, CSS, & JavaScript render newsfeed Request Response Algorithm determines content of feed. Sends back HTML, CSS, JavaScript files Application LogicApplication Logic Initial requestInitial request Following responseFollowing response 9
  • 10.
    Example: facebook.com Client Server Openbrowser and navigate to facebook.com HTML, CSS, & JavaScript render newsfeed Request Response Algorithm determines content of feed. Sends back HTML, CSS, JavaScript files Application LogicApplication Logic Initial requestInitial request Following responseFollowing response We'll be writing JavaScript, the code that the browser uses to run the app 10
  • 11.
    History of JavaScript Writtenby Brendan Eich in 1995 for Netscape Initial version written in 10 days Completely unrelated to Java, but may be named after it to draft off its popularity Over 10 years, became default programming language for browsers 11
  • 12.
    Defining a variablewith JavaScript var numberOfSheep = 20 Initialize variable Name of variable Value of variable 12
  • 13.
  • 14.
    Declaring a functionwith JavaScript function greet() { return "Hello world!"; } Initialize function Name of function What the function does 14
  • 15.
  • 16.
    If/Else Statements go togas stationkeep driving if false if true need gas? family roadtrip 16
  • 17.
    If/Else Statements function familyRoadtrip(){ if (needGas == true) { getGas(); } else { keepDriving(); } } 17
  • 18.
    Comparing Values == (equalto) 5 == 5 --> true 5 == 6 --> false != (not equal to) 5 != 5 --> false 5 != 6 --> true 18
  • 19.
    If/Else Statements andComparing Values 19
  • 20.
    Parameters within functions functionadder(a, b) { return a + b; } adder(1,2); Parameters in declaration Parameters used within the function 20
  • 21.
    Examples of parameterswithin functions 21
  • 22.
    Real developers useGoogle... a lot 22
  • 23.
    Repl.it setup &first steps! http://bit.ly/tf-intro-js-challenges 23
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.