Intro to JavaScript:
Fundamentals
January 2018
bit.ly/phx-intro-js
1
About us
Dave Hoel, Instructor
Software Developer
Thinkful Graduate
Joe Previte, TA
Digital Marketer, Software Developer
Thinkful Workshop Instructor
2
About you!
What's your name?
What brought you here today?
What is your programming experience?
3
About Thinkful
We train developers and data scientists
through 1x1 mentorship and project-based
learning.
Guaranteed.Guaranteed.
4
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)
5
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
6
Client/Servers
Client (sends requests)
Frontend Developer
Manages what user sees
Server (sends response)
Backend Developer
Manages what app does
7
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
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
We'll be writing JavaScript, the code
that the browser uses to run the app
9
Defining a variable with JavaScript
var numberOfSheep = 20
Initialize variable
Name of variable
Value of variable
10
Variable examples
11
Declaring a function with JavaScript
function greet() {
return "Hello world!";
}
Initialize function Name of function
What the function does
12
Function examples
13
If/Else Statements
go to gas stationkeep driving
if false if true
need gas?
family roadtrip
14
If/Else Statements
function familyRoadtrip() {
if (needGas == true) {
getGas();
}
else {
keepDriving();
}
}
15
Comparing Values
== (equal to)
5 == 5 --> true
5 == 6 --> false
!= (not equal to)
5 != 5 --> false
5 != 6 --> true
16
If/Else Statements and Comparing Values
17
Parameters within functions
function adder(a, b) {
return a + b;
}
adder(1,2);
Parameters in declaration
Parameters used
within the function
18
Examples of parameters within functions
19
Real developers use Google... a lot
20
Repl.it setup & first steps!
http://bit.ly/tf-intro-js-challenges
21
22
Thinkful's Free Course
75+ hours of curriculum for two weeks
HTML, CSS and JavaScript
Unlimited mentor-led Q&A sessions
Personal Program Manager (me!)
Completed work will roll over into paid
program, tuition will be prorated
Thinkful Coding Prep CourseThinkful Coding Prep Course
$1500 FREEFREE
23

Itjsf129

  • 1.
  • 2.
    About us Dave Hoel,Instructor Software Developer Thinkful Graduate Joe Previte, TA Digital Marketer, Software Developer Thinkful Workshop Instructor 2
  • 3.
    About you! What's yourname? What brought you here today? What is your programming experience? 3
  • 4.
    About Thinkful We traindevelopers and data scientists through 1x1 mentorship and project-based learning. Guaranteed.Guaranteed. 4
  • 5.
    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) 5
  • 6.
    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 6
  • 7.
    Client/Servers Client (sends requests) FrontendDeveloper Manages what user sees Server (sends response) Backend Developer Manages what app does 7
  • 8.
    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 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 We'll be writing JavaScript, the code that the browser uses to run the app 9
  • 10.
    Defining a variablewith JavaScript var numberOfSheep = 20 Initialize variable Name of variable Value of variable 10
  • 11.
  • 12.
    Declaring a functionwith JavaScript function greet() { return "Hello world!"; } Initialize function Name of function What the function does 12
  • 13.
  • 14.
    If/Else Statements go togas stationkeep driving if false if true need gas? family roadtrip 14
  • 15.
    If/Else Statements function familyRoadtrip(){ if (needGas == true) { getGas(); } else { keepDriving(); } } 15
  • 16.
    Comparing Values == (equalto) 5 == 5 --> true 5 == 6 --> false != (not equal to) 5 != 5 --> false 5 != 6 --> true 16
  • 17.
    If/Else Statements andComparing Values 17
  • 18.
    Parameters within functions functionadder(a, b) { return a + b; } adder(1,2); Parameters in declaration Parameters used within the function 18
  • 19.
    Examples of parameterswithin functions 19
  • 20.
    Real developers useGoogle... a lot 20
  • 21.
    Repl.it setup &first steps! http://bit.ly/tf-intro-js-challenges 21
  • 22.
  • 23.
    Thinkful's Free Course 75+hours of curriculum for two weeks HTML, CSS and JavaScript Unlimited mentor-led Q&A sessions Personal Program Manager (me!) Completed work will roll over into paid program, tuition will be prorated Thinkful Coding Prep CourseThinkful Coding Prep Course $1500 FREEFREE 23