SlideShare a Scribd company logo
Intro to JavaScript
May 2017
http://bit.ly/js-intro-dc
About us
We train developers and data
scientists through 1-on-1
mentorship and career prep
About me
• TJ Stalcup
• Lead DC Mentor @ Thinkful
• API Evangelist @ WealthEngine
• Github: tjstalcup
• Twitter: @tjstalcup
Our TA for tonight
• Randall Olade
• DC Mentor @ Thinkful
• Experience with .NET &
MEA(R)N Stack
About you
• Why are you here?
• Already work with developers
• Career Opportunity
• Next Facebook
• What is your programming experience?
• None
• 3 months self-taught
• Master (3+ Months)
Format for tonight
• Basics of how the web works
• Background about Javascript
• Review key Javascript concepts
• Practice with some challenges
• Next steps
What is programming?
Programming is writing instructions for a computer to
execute. Programming is problem-solving.
Programming is a process
1. Defining problems
2. Finding solutions to those problems
3. Implementing those solutions in a language your
computer can understand
Perception
Reality
How the web works
Type a URL from a client (e.g. google.com)
Browser communicates with DNS server to
find IP address
Browser sends an HTTP request asking
for specific files
Browser receives those files and renders
them as a website
Clients / Servers
Client (sends requests)
Frontend Developer
Manages what user sees
Server (sends response)
Backend Developer
Manage what app does
Example: facebook.com
HTML, CSS, &
Javascript render
interactive newsfeed
Algorithm determines
what’s in your feed
Request
Get data about your
friends’s and their posts
Open browser
and navigate to
facebook.com
Application Logic
Database
Response
Client Server
Brief 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
Javascript is extremely popular
This makes it a good place to start
• Has large community of developers, libraries and
frameworks
• Lots of job opportunities
• Also the syntax is easier to understand for first-time
developers
Are we learning frontend or backend?
100% of client-side web development is in Javascript.
You can also use Javascript to write server-side code
thanks to Node.js. So technically both!
Concepts we’ll cover
• Variables
• Data types: strings, numbers, booleans
• Functions
Note on where to write you code
When working as a programmer, you’ll use a text editor
or an “Integrated Development Environment” (IDE).
Tonight we’re using JSBin so we can skip setup, see
results immediately and easily share code
Javascript variables
• A variable is a name that is attached to a value — it gives
us a shorthand way to refer to the value elsewhere
• Helps us remember things while we’re executing a
program: “managing state”
• Example on JSBin: http://bit.ly/js-example-one
Examples
• Declaring variable: var firstVariable;
• Assigning value: firstVariable = 6;
• Retrieve value: alert(firstVariable)
Example on JSBin: http://bit.ly/js-example-two
Best practices for naming variables
• Names should be (extra) descriptive: “numberOfCats”
is better than “x”
• Use camelCasing where first word starts with lower
case, subsequent words are upper case
• Must start variable names with a letter
What values can be assigned to a variable?
• String
• Number
• Boolean
• Also Null, Undefined, Arrays, and Objects
Introducing strings
We use strings a lot. Strings are created with opening
and closing quotes (either single or double):
var foo = ‘bar’;
var bar = “foo”;
Combining (or “concatenating”) strings
Javascript lets you combine two strings by using the +
operator. Let’s try it in the console!
var host = “Thinkful”;
var className = “Intro to Javascript”;
console.log(className + “ with “ + host);
=> Intro to Javascript with Thinkful
Quick challenge
• Open JSBin in your browser
• Store your first name in one variable
• Store your last name in another variable
• Combine the two and log your full name
Introducing numbers
The number type in Javascript is used to represent all
kinds of numbers, including integers and decimals.
var integerNumber = 3;
var floatingPointNumber = 3.00;
Quick challenge
• Open JSBin
• Store two numbers in two different variables
• Add the two numbers
• Multiply the two numbers
Introducing booleans
Boolean is just a fancy word for “true” or “false”
var loggedIn = true;
if (loggedIn == true) {
alert(“loggedIn was set to true!”)
}
Basic functions
A function lets you separate your code into bite-sized
pieces which you can use over again.
When you write a function to use later, you are
“declaring” it. When you use (or run) that function you
are “calling” it.
Example
Declaring a function
function doSomething() {
alert(“Done!”);
}
Calling a function
doSomething();
More about basic functions
• Functions can save us time because we can use them
over and over code. They are like building blocks.
• Functions make your code more organized and easier
to read
• Javascript has many built-in functions — you’ve already
used a couple!
• In writing less trivial programs, you’ll write many, many
functions
Challenge #1
• Go to JSBin.com, make sure auto-run with Javascript
isn’t selected
• Declare and call this function:
function myFirstFunction() {
console.log(“Hello World!”);
}
myFirstFunction();
• Click “Run with JS” to see output in console
Challenge #2
• Open JSBin
• Write a function that logs your name
• Write a function that adds two numbers and logs the
result
• Call both functions
More advanced functions — parameters and return
• We can “give” a function some values to use. We call
the values we send into a function “parameters”
• We can have a function give a single value back. We
use a “return” statement to do that.
• We define what parameters the function accepts when
we declare the function.
• We send the actual parameters when we call the
function — we put those parameters in the parentheses.
Example: addTwoNumbers(2, 3);
An example
function addTwoNumbers(firstNumber, secondNumber) {
return firstNumber + secondNumber;
}
var result = addTwoNumbers(2, 3);
alert(result);
Challenge
• Open JSBin
• Write a function that takes your first name and your last
name as two parameters
• Return a string with your full name
• Call that function
Ways to keep learningLevelofsupport
Learning methods
1-on-1 mentorship enables flexibility
325+ mentors with an average of 10
years of experience in the field
Support ‘round the clock
Our results
Job Titles after GraduationMonths until Employed
Try us out!
• Initial 2-week trial
includes six mentor
sessions for $50
• Learn HTML/CSS and
JavaScript
• Option to continue
onto web
development
bootcamp
• Talk to me (or email
tj@thinkful.com) if
you’re interested

More Related Content

What's hot (20)

ODP
Getting started with typescript and angular 2
Knoldus Inc.
 
PPT
Web development basics (Part-4)
Rajat Pratap Singh
 
PDF
Before you jump into Angular
M A Hossain Tonu
 
PPTX
JS Event Loop
Saai Vignesh P
 
PPTX
TypeScript - Silver Bullet for the Full-stack Developers
Rutenis Turcinas
 
PDF
Dynamically Composing Collection Operations through Collection Promises
Marcus Denker
 
PPTX
Javascript 01 (js)
AbhishekMondal42
 
PDF
Advanced Reflection in Pharo
Marcus Denker
 
PDF
Angular - Chapter 2 - TypeScript Programming
WebStackAcademy
 
PPTX
Programming Paradigm & Languages
Gaditek
 
PPTX
Introduction to JavaScript Programming
Raveendra R
 
PDF
Xtend - better java with -less- noise
Neeraj Bhusare
 
PPTX
JavaScript Core fundamentals - Learn JavaScript Here
Laurence Svekis ✔
 
PDF
Introduction to Javascript programming
Fulvio Corno
 
PPT
Java Script ppt
Priya Goyal
 
PPTX
Introduction to JavaScript
Marlon Jamera
 
PDF
Back to the future: Isomorphic javascript applications
Luciano Colosio
 
PDF
Basic JavaScript Tutorial
DHTMLExtreme
 
PPTX
Introduction To JavaScript
Reema
 
Getting started with typescript and angular 2
Knoldus Inc.
 
Web development basics (Part-4)
Rajat Pratap Singh
 
Before you jump into Angular
M A Hossain Tonu
 
JS Event Loop
Saai Vignesh P
 
TypeScript - Silver Bullet for the Full-stack Developers
Rutenis Turcinas
 
Dynamically Composing Collection Operations through Collection Promises
Marcus Denker
 
Javascript 01 (js)
AbhishekMondal42
 
Advanced Reflection in Pharo
Marcus Denker
 
Angular - Chapter 2 - TypeScript Programming
WebStackAcademy
 
Programming Paradigm & Languages
Gaditek
 
Introduction to JavaScript Programming
Raveendra R
 
Xtend - better java with -less- noise
Neeraj Bhusare
 
JavaScript Core fundamentals - Learn JavaScript Here
Laurence Svekis ✔
 
Introduction to Javascript programming
Fulvio Corno
 
Java Script ppt
Priya Goyal
 
Introduction to JavaScript
Marlon Jamera
 
Back to the future: Isomorphic javascript applications
Luciano Colosio
 
Basic JavaScript Tutorial
DHTMLExtreme
 
Introduction To JavaScript
Reema
 

Similar to Thinkful - Intro to JavaScript (20)

PDF
Intro to JavaScript - Thinkful LA
Thinkful
 
PDF
ABCs of Programming_eBook Contents
Ashley Menhennett
 
PDF
Training javascript 2012 hcmut
University of Technology
 
PPTX
gdscWorkShopJavascriptintroductions.pptx
sandeshshahapur
 
PPTX
copa-ii.pptx
ERHariramPrajapat
 
PDF
javascriptPresentation.pdf
wildcat9335
 
PPTX
Lecture 5 javascript
Mujtaba Haider
 
PPTX
An introduction to javascript
tonyh1
 
PDF
Introjs2.13.18sd
Jordan Zurowski
 
PPTX
An Introduction to JavaScript
tonyh1
 
PDF
Deck 8983a1d9-68df-4447-8481-3b4fd0de734c-9-52-74-451
Justin Ezor
 
PPTX
Introduction to JavaScript - Web Programming
tyfeng7
 
PPT
Javascript
Manav Prasad
 
PPTX
Learning space presentation1 learn Java script
engmk83
 
PDF
Deck 893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-55-78-171-219-304-310-388 (1)
Justin Ezor
 
PDF
Introjs1.9.18tf
Thinkful
 
PPT
JavaScript - An Introduction
Manvendra Singh
 
PDF
Intro to JavaScript
Aaron Lamphere
 
PPTX
Coding 101: A hands-on introduction
Bohyun Kim
 
PDF
Itjsf13
Thinkful
 
Intro to JavaScript - Thinkful LA
Thinkful
 
ABCs of Programming_eBook Contents
Ashley Menhennett
 
Training javascript 2012 hcmut
University of Technology
 
gdscWorkShopJavascriptintroductions.pptx
sandeshshahapur
 
copa-ii.pptx
ERHariramPrajapat
 
javascriptPresentation.pdf
wildcat9335
 
Lecture 5 javascript
Mujtaba Haider
 
An introduction to javascript
tonyh1
 
Introjs2.13.18sd
Jordan Zurowski
 
An Introduction to JavaScript
tonyh1
 
Deck 8983a1d9-68df-4447-8481-3b4fd0de734c-9-52-74-451
Justin Ezor
 
Introduction to JavaScript - Web Programming
tyfeng7
 
Javascript
Manav Prasad
 
Learning space presentation1 learn Java script
engmk83
 
Deck 893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-55-78-171-219-304-310-388 (1)
Justin Ezor
 
Introjs1.9.18tf
Thinkful
 
JavaScript - An Introduction
Manvendra Singh
 
Intro to JavaScript
Aaron Lamphere
 
Coding 101: A hands-on introduction
Bohyun Kim
 
Itjsf13
Thinkful
 
Ad

More from TJ Stalcup (20)

PDF
Intro to JavaScript - Thinkful DC
TJ Stalcup
 
PDF
Frontend Crash Course
TJ Stalcup
 
PDF
Intro to Python for Data Science
TJ Stalcup
 
PDF
Intro to Python for Data Science
TJ Stalcup
 
PDF
Build Your Own Website - Intro to HTML & CSS
TJ Stalcup
 
PDF
Intro to Python
TJ Stalcup
 
PDF
Intro to Python
TJ Stalcup
 
PDF
Predict the Oscars using Data Science
TJ Stalcup
 
PDF
Thinkful DC - Intro to JavaScript
TJ Stalcup
 
PDF
Data Science Your Vacation
TJ Stalcup
 
PDF
Data Science Your Vacation
TJ Stalcup
 
PDF
Build a Game with Javascript
TJ Stalcup
 
PDF
Thinkful DC FrontEnd Crash Course - HTML & CSS
TJ Stalcup
 
PDF
Build Your Own Instagram Filters
TJ Stalcup
 
PDF
Choosing a Programming Language
TJ Stalcup
 
PDF
Frontend Crash Course
TJ Stalcup
 
PDF
Thinkful FrontEnd Crash Course - HTML & CSS
TJ Stalcup
 
PDF
Thinkful FrontEnd Crash Course - HTML & CSS
TJ Stalcup
 
PDF
Build a Virtual Pet with JavaScript
TJ Stalcup
 
PDF
Intro to Javascript
TJ Stalcup
 
Intro to JavaScript - Thinkful DC
TJ Stalcup
 
Frontend Crash Course
TJ Stalcup
 
Intro to Python for Data Science
TJ Stalcup
 
Intro to Python for Data Science
TJ Stalcup
 
Build Your Own Website - Intro to HTML & CSS
TJ Stalcup
 
Intro to Python
TJ Stalcup
 
Intro to Python
TJ Stalcup
 
Predict the Oscars using Data Science
TJ Stalcup
 
Thinkful DC - Intro to JavaScript
TJ Stalcup
 
Data Science Your Vacation
TJ Stalcup
 
Data Science Your Vacation
TJ Stalcup
 
Build a Game with Javascript
TJ Stalcup
 
Thinkful DC FrontEnd Crash Course - HTML & CSS
TJ Stalcup
 
Build Your Own Instagram Filters
TJ Stalcup
 
Choosing a Programming Language
TJ Stalcup
 
Frontend Crash Course
TJ Stalcup
 
Thinkful FrontEnd Crash Course - HTML & CSS
TJ Stalcup
 
Thinkful FrontEnd Crash Course - HTML & CSS
TJ Stalcup
 
Build a Virtual Pet with JavaScript
TJ Stalcup
 
Intro to Javascript
TJ Stalcup
 
Ad

Recently uploaded (20)

PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 

Thinkful - Intro to JavaScript

  • 1. Intro to JavaScript May 2017 http://bit.ly/js-intro-dc
  • 2. About us We train developers and data scientists through 1-on-1 mentorship and career prep
  • 3. About me • TJ Stalcup • Lead DC Mentor @ Thinkful • API Evangelist @ WealthEngine • Github: tjstalcup • Twitter: @tjstalcup
  • 4. Our TA for tonight • Randall Olade • DC Mentor @ Thinkful • Experience with .NET & MEA(R)N Stack
  • 5. About you • Why are you here? • Already work with developers • Career Opportunity • Next Facebook • What is your programming experience? • None • 3 months self-taught • Master (3+ Months)
  • 6. Format for tonight • Basics of how the web works • Background about Javascript • Review key Javascript concepts • Practice with some challenges • Next steps
  • 7. What is programming? Programming is writing instructions for a computer to execute. Programming is problem-solving.
  • 8. Programming is a process 1. Defining problems 2. Finding solutions to those problems 3. Implementing those solutions in a language your computer can understand
  • 11. How the web works Type a URL from a client (e.g. google.com) Browser communicates with DNS server to find IP address Browser sends an HTTP request asking for specific files Browser receives those files and renders them as a website
  • 12. Clients / Servers Client (sends requests) Frontend Developer Manages what user sees Server (sends response) Backend Developer Manage what app does
  • 13. Example: facebook.com HTML, CSS, & Javascript render interactive newsfeed Algorithm determines what’s in your feed Request Get data about your friends’s and their posts Open browser and navigate to facebook.com Application Logic Database Response Client Server
  • 14. Brief 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
  • 16. This makes it a good place to start • Has large community of developers, libraries and frameworks • Lots of job opportunities • Also the syntax is easier to understand for first-time developers
  • 17. Are we learning frontend or backend? 100% of client-side web development is in Javascript. You can also use Javascript to write server-side code thanks to Node.js. So technically both!
  • 18. Concepts we’ll cover • Variables • Data types: strings, numbers, booleans • Functions
  • 19. Note on where to write you code When working as a programmer, you’ll use a text editor or an “Integrated Development Environment” (IDE). Tonight we’re using JSBin so we can skip setup, see results immediately and easily share code
  • 20. Javascript variables • A variable is a name that is attached to a value — it gives us a shorthand way to refer to the value elsewhere • Helps us remember things while we’re executing a program: “managing state” • Example on JSBin: http://bit.ly/js-example-one
  • 21. Examples • Declaring variable: var firstVariable; • Assigning value: firstVariable = 6; • Retrieve value: alert(firstVariable) Example on JSBin: http://bit.ly/js-example-two
  • 22. Best practices for naming variables • Names should be (extra) descriptive: “numberOfCats” is better than “x” • Use camelCasing where first word starts with lower case, subsequent words are upper case • Must start variable names with a letter
  • 23. What values can be assigned to a variable? • String • Number • Boolean • Also Null, Undefined, Arrays, and Objects
  • 24. Introducing strings We use strings a lot. Strings are created with opening and closing quotes (either single or double): var foo = ‘bar’; var bar = “foo”;
  • 25. Combining (or “concatenating”) strings Javascript lets you combine two strings by using the + operator. Let’s try it in the console! var host = “Thinkful”; var className = “Intro to Javascript”; console.log(className + “ with “ + host); => Intro to Javascript with Thinkful
  • 26. Quick challenge • Open JSBin in your browser • Store your first name in one variable • Store your last name in another variable • Combine the two and log your full name
  • 27. Introducing numbers The number type in Javascript is used to represent all kinds of numbers, including integers and decimals. var integerNumber = 3; var floatingPointNumber = 3.00;
  • 28. Quick challenge • Open JSBin • Store two numbers in two different variables • Add the two numbers • Multiply the two numbers
  • 29. Introducing booleans Boolean is just a fancy word for “true” or “false” var loggedIn = true; if (loggedIn == true) { alert(“loggedIn was set to true!”) }
  • 30. Basic functions A function lets you separate your code into bite-sized pieces which you can use over again. When you write a function to use later, you are “declaring” it. When you use (or run) that function you are “calling” it.
  • 31. Example Declaring a function function doSomething() { alert(“Done!”); } Calling a function doSomething();
  • 32. More about basic functions • Functions can save us time because we can use them over and over code. They are like building blocks. • Functions make your code more organized and easier to read • Javascript has many built-in functions — you’ve already used a couple! • In writing less trivial programs, you’ll write many, many functions
  • 33. Challenge #1 • Go to JSBin.com, make sure auto-run with Javascript isn’t selected • Declare and call this function: function myFirstFunction() { console.log(“Hello World!”); } myFirstFunction(); • Click “Run with JS” to see output in console
  • 34. Challenge #2 • Open JSBin • Write a function that logs your name • Write a function that adds two numbers and logs the result • Call both functions
  • 35. More advanced functions — parameters and return • We can “give” a function some values to use. We call the values we send into a function “parameters” • We can have a function give a single value back. We use a “return” statement to do that. • We define what parameters the function accepts when we declare the function. • We send the actual parameters when we call the function — we put those parameters in the parentheses. Example: addTwoNumbers(2, 3);
  • 36. An example function addTwoNumbers(firstNumber, secondNumber) { return firstNumber + secondNumber; } var result = addTwoNumbers(2, 3); alert(result);
  • 37. Challenge • Open JSBin • Write a function that takes your first name and your last name as two parameters • Return a string with your full name • Call that function
  • 38. Ways to keep learningLevelofsupport Learning methods
  • 39. 1-on-1 mentorship enables flexibility 325+ mentors with an average of 10 years of experience in the field
  • 41. Our results Job Titles after GraduationMonths until Employed
  • 42. Try us out! • Initial 2-week trial includes six mentor sessions for $50 • Learn HTML/CSS and JavaScript • Option to continue onto web development bootcamp • Talk to me (or email [email protected]) if you’re interested