Intro to Javascript
June 2017
Wi-Fi: TechSquare Labs
Password: bu1ldsometh1ngb1g
http://bit.ly/tf-intro-js
1
Instructor
Jon Brown
Web Coordinator
Thinkful Student
TAs
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
2
About you
What's your name?
What brought you here today?
What is your programming experience?
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
3
About Thinkful
Thinkful helps people become developers or data scientists
through 1-on-1 mentorship and project-based learning
These workshops are built using this approach.These workshops are built using this approach.
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
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
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
5
Agenda
Learn key Javascript concepts (30 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)
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
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
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
7
Client/Servers
Client (sends requests)
Frontend Developer
Manages what user sees
Server (sends response)
Backend Developer
Manages what app does
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
8
Example: facebook.com
Client Server
Open browser
and navigate to
facebook.com
HTML, CSS, &
Javascrip render
newsfeed
Request
Response
Algorithm
determines
content of feed.
Sends back
HTML, CSS,
Javascript files
Application LogicApplication Logic
Initial requestInitial request
Following responseFollowing response
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g
9
bit.ly/tf-intro-js
Example: facebook.com
Client Server
Open browser
and navigate to
facebook.com
HTML, CSS, &
Javascrip 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
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
History of Javascript
Written by Brendan Eich in 1995 for Netscape
Initial version written in 10 days
Completely unrelated to Java, but maybe named after it to
draft off its popularity
Over 10 years, became default programming language for
browsers
Continues to evolve under guidance of ECMA International,
with input from top tech companies
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
11
Javascript today
Has large community of developers, libraries and
frameworks
Lots of job opportunities
Also the syntax is easier to understand for first-time
developers
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
12
Defining a variable with Javascript
var numberOfSheep = 20
Initialize variable
Name of variable
Value of variable
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
13
Variable examples
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
14
Declaring a function with Javascript
function greet() {
return "Hello world!";
}
Initialize function Name of function
What the function does
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
15
Function examples
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
16
If/Else Statements
go to gas stationkeep driving
if false if true
need gas?
family roadtrip
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
17
If/Else Statements
function familyRoadtrip() {
if (needGas == true) {
getGas();
}
else {
keepDriving();
}
}
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
18
Comparing Values
== (equal to)
5 == 5 --> true
5 == 6 --> false
!= (not equal to)
5 != 5 --> false
5 != 6 --> true
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
19
If/Else Statements and Comparing Values
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
20
Parameters within functions
function adder(a, b) {
return a + b;
}
adder(1,2);
Parameters in declaration
Parameters used
within the function
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
21
Examples of parameters within functions
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
22
Real developers use Google... a lot
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
23
Repl.it setup & first steps!
http://bit.ly/tf-intro-js-challenges
Wi-Fi: TechSquare Labs
Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
24
Ways to keep learning
More Structure
Less Structure
More SupportLess Support
25
325+ mentors325+ mentors with an average of
10 years of experience10 years of experience in the
field
26
Support 'round the clock
Your Mentor
Q&A Sessions
Career Coach
In-person Workshops
Slack
Program Manager
YouYou
27
Our results
93%93%job-placement rate + job guarantee
Kaeside IwuagwuKaeside Iwuagwu
Link for the third party audit jobs report:
https://www.thinkful.com/bootcamp-jobs-https://www.thinkful.com/bootcamp-jobs-
statsstats
Frontend Developer
Sierra GreggSierra Gregg
Software Engineer
JP EarnestJP Earnest
Web Developer
28
Trying Thinkful
Talk to me (or email jasjit@thinkful.com ) if you'reTalk to me (or email jasjit@thinkful.com ) if you're
interestedinterested
Get a free trial of Thinkful
with three mentor sessions
Starting with HTML/CSS/JS,
with option to continue to
full program
29

Deck 8983a1d9-68df-4447-8481-3b4fd0de734c-9-28

  • 1.
    Intro to Javascript June2017 Wi-Fi: TechSquare Labs Password: bu1ldsometh1ngb1g http://bit.ly/tf-intro-js 1
  • 2.
    Instructor Jon Brown Web Coordinator ThinkfulStudent TAs Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 2
  • 3.
    About you What's yourname? What brought you here today? What is your programming experience? Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 3
  • 4.
    About Thinkful Thinkful helpspeople become developers or data scientists through 1-on-1 mentorship and project-based learning These workshops are built using this approach.These workshops are built using this approach. Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 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 Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 5
  • 6.
    Agenda Learn key Javascriptconcepts (30 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) Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 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 Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 7
  • 8.
    Client/Servers Client (sends requests) FrontendDeveloper Manages what user sees Server (sends response) Backend Developer Manages what app does Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 8
  • 9.
    Example: facebook.com Client Server Openbrowser and navigate to facebook.com HTML, CSS, & Javascrip render newsfeed Request Response Algorithm determines content of feed. Sends back HTML, CSS, Javascript files Application LogicApplication Logic Initial requestInitial request Following responseFollowing response Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g 9 bit.ly/tf-intro-js
  • 10.
    Example: facebook.com Client Server Openbrowser and navigate to facebook.com HTML, CSS, & Javascrip 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 Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js
  • 11.
    History of Javascript Writtenby Brendan Eich in 1995 for Netscape Initial version written in 10 days Completely unrelated to Java, but maybe named after it to draft off its popularity Over 10 years, became default programming language for browsers Continues to evolve under guidance of ECMA International, with input from top tech companies Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 11
  • 12.
    Javascript today Has largecommunity of developers, libraries and frameworks Lots of job opportunities Also the syntax is easier to understand for first-time developers Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 12
  • 13.
    Defining a variablewith Javascript var numberOfSheep = 20 Initialize variable Name of variable Value of variable Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 13
  • 14.
    Variable examples Wi-Fi: TechSquareLabs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 14
  • 15.
    Declaring a functionwith Javascript function greet() { return "Hello world!"; } Initialize function Name of function What the function does Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 15
  • 16.
    Function examples Wi-Fi: TechSquareLabs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 16
  • 17.
    If/Else Statements go togas stationkeep driving if false if true need gas? family roadtrip Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 17
  • 18.
    If/Else Statements function familyRoadtrip(){ if (needGas == true) { getGas(); } else { keepDriving(); } } Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 18
  • 19.
    Comparing Values == (equalto) 5 == 5 --> true 5 == 6 --> false != (not equal to) 5 != 5 --> false 5 != 6 --> true Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 19
  • 20.
    If/Else Statements andComparing Values Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 20
  • 21.
    Parameters within functions functionadder(a, b) { return a + b; } adder(1,2); Parameters in declaration Parameters used within the function Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 21
  • 22.
    Examples of parameterswithin functions Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 22
  • 23.
    Real developers useGoogle... a lot Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 23
  • 24.
    Repl.it setup &first steps! http://bit.ly/tf-intro-js-challenges Wi-Fi: TechSquare Labs Pass: bu1ldsometh1ngb1g bit.ly/tf-intro-js 24
  • 25.
    Ways to keeplearning More Structure Less Structure More SupportLess Support 25
  • 26.
    325+ mentors325+ mentorswith an average of 10 years of experience10 years of experience in the field 26
  • 27.
    Support 'round theclock Your Mentor Q&A Sessions Career Coach In-person Workshops Slack Program Manager YouYou 27
  • 28.
    Our results 93%93%job-placement rate+ job guarantee Kaeside IwuagwuKaeside Iwuagwu Link for the third party audit jobs report: https://www.thinkful.com/bootcamp-jobs-https://www.thinkful.com/bootcamp-jobs- statsstats Frontend Developer Sierra GreggSierra Gregg Software Engineer JP EarnestJP Earnest Web Developer 28
  • 29.
    Trying Thinkful Talk tome (or email [email protected] ) if you'reTalk to me (or email [email protected] ) if you're interestedinterested Get a free trial of Thinkful with three mentor sessions Starting with HTML/CSS/JS, with option to continue to full program 29