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

PDF
Intro to javascript (6:19)
PDF
Intro to JavaScript - Thinkful LA, June 2017
PDF
Intro to javascript (6:27)
PDF
Intro to javascript (5:2)
PDF
Variables in Pharo5
PDF
Javascript
PPTX
JavaScript Basics
PDF
Reflection in Pharo: Beyond Smalltak
Intro to javascript (6:19)
Intro to JavaScript - Thinkful LA, June 2017
Intro to javascript (6:27)
Intro to javascript (5:2)
Variables in Pharo5
Javascript
JavaScript Basics
Reflection in Pharo: Beyond Smalltak

What's hot (20)

ODP
Getting started with typescript and angular 2
PPT
Web development basics (Part-4)
PDF
Before you jump into Angular
PPTX
JS Event Loop
PPTX
TypeScript - Silver Bullet for the Full-stack Developers
PDF
Dynamically Composing Collection Operations through Collection Promises
PPTX
Javascript 01 (js)
PDF
Advanced Reflection in Pharo
PDF
Angular - Chapter 2 - TypeScript Programming
PPTX
Programming Paradigm & Languages
PPTX
Introduction to JavaScript Programming
PDF
Xtend - better java with -less- noise
PPTX
JavaScript Core fundamentals - Learn JavaScript Here
PDF
Introduction to Javascript programming
PPT
Java Script ppt
PPTX
Introduction to JavaScript
PDF
Back to the future: Isomorphic javascript applications
PDF
Basic JavaScript Tutorial
PPTX
Introduction To JavaScript
Getting started with typescript and angular 2
Web development basics (Part-4)
Before you jump into Angular
JS Event Loop
TypeScript - Silver Bullet for the Full-stack Developers
Dynamically Composing Collection Operations through Collection Promises
Javascript 01 (js)
Advanced Reflection in Pharo
Angular - Chapter 2 - TypeScript Programming
Programming Paradigm & Languages
Introduction to JavaScript Programming
Xtend - better java with -less- noise
JavaScript Core fundamentals - Learn JavaScript Here
Introduction to Javascript programming
Java Script ppt
Introduction to JavaScript
Back to the future: Isomorphic javascript applications
Basic JavaScript Tutorial
Introduction To JavaScript
Ad

Similar to Thinkful - Intro to JavaScript (20)

PDF
Intro to JavaScript - Thinkful LA
PDF
ABCs of Programming_eBook Contents
PDF
Training javascript 2012 hcmut
PPTX
gdscWorkShopJavascriptintroductions.pptx
PPTX
copa-ii.pptx
PDF
javascriptPresentation.pdf
PPTX
Lecture 5 javascript
PPTX
An introduction to javascript
PDF
Introjs2.13.18sd
PPTX
An Introduction to JavaScript
PDF
Deck 8983a1d9-68df-4447-8481-3b4fd0de734c-9-52-74-451
PPTX
Introduction to JavaScript - Web Programming
PPT
Javascript
PPTX
Learning space presentation1 learn Java script
PDF
Deck 893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-55-78-171-219-304-310-388 (1)
PDF
Introjs1.9.18tf
PPT
JavaScript - An Introduction
PDF
Intro to JavaScript
PPTX
Coding 101: A hands-on introduction
PDF
Itjsf13
Intro to JavaScript - Thinkful LA
ABCs of Programming_eBook Contents
Training javascript 2012 hcmut
gdscWorkShopJavascriptintroductions.pptx
copa-ii.pptx
javascriptPresentation.pdf
Lecture 5 javascript
An introduction to javascript
Introjs2.13.18sd
An Introduction to JavaScript
Deck 8983a1d9-68df-4447-8481-3b4fd0de734c-9-52-74-451
Introduction to JavaScript - Web Programming
Javascript
Learning space presentation1 learn Java script
Deck 893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-55-78-171-219-304-310-388 (1)
Introjs1.9.18tf
JavaScript - An Introduction
Intro to JavaScript
Coding 101: A hands-on introduction
Itjsf13
Ad

More from TJ Stalcup (20)

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

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Encapsulation theory and applications.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
KodekX | Application Modernization Development
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Electronic commerce courselecture one. Pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Encapsulation theory and applications.pdf
Big Data Technologies - Introduction.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
KodekX | Application Modernization Development
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Network Security Unit 5.pdf for BCA BBA.
Advanced methodologies resolving dimensionality complications for autism neur...
“AI and Expert System Decision Support & Business Intelligence Systems”
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
NewMind AI Weekly Chronicles - August'25 Week I
sap open course for s4hana steps from ECC to s4
Unlocking AI with Model Context Protocol (MCP)
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

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