SlideShare a Scribd company logo
June 2017
Intro to JavaScript
WIFI: Cross Campus Events
bit.ly/intro-js-la
About us
We train developers and data
scientists through 1-on-1
mentorship and career prep
About me
• Brendan Barr
• Full-stack JavaScript developer
• LA-based Thinkful mentor
About you
• What are your programming goals?
• I’d like to become a developer
• I have an idea I’d like to build
• I’d like to work better with developer
• What is your programming experience?
• First lines of code will be written tonight!
• Been self-teaching for 1-3 months
• Been at this for longer than 3 months
Format for tonight
• Basics of how the web works
• Background about Javascript
• Review key Javascript concepts
• Practice with some challenges
• Next steps to continue learning
Before we get started…
• Chrome Developer Tools provides an
interactive JavaScript console, where you
can run and debug code:
• View -> Developer -> JavaScript console
• Shortcut: option-command-J on a Mac;
Ctrl + Shift + J on a PC
• Type the following command and hit enter:
alert(“Hello world!”);
• Type: 2+2;
What is programming?
Programming is writing instructions for a computer to
execute. Programming is problem-solving.
How the web works
Type a URL from a client (e.g. facebook.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, named as a
marketing stunt because Java was “hot” at the
time
• Continues to evolve under guidance of ECMA
International, driven by browser makers
Javascript today
JavaScript is the most commonly used programming language on earth. Even Back-
End developers are more likely to use it than any other language.
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(numberOne, numberTwo) {
return numberOne + numberTwo;
}
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
Learning to learn
• Google is your friend!
• Practice at the edge of your abilities
• Ignore the hot new thing. Instead go deep with one
technology
Ways to keep learningLevelofsupport
Structure efficiency
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
noel@thinkful.com) if
you’re interested
October 2015
Questions?
noel@thinkful.com
schedule a call through thinkful.com

More Related Content

What's hot (20)

Javascript 01 (js)
Javascript 01 (js)Javascript 01 (js)
Javascript 01 (js)
AbhishekMondal42
 
Web development basics (Part-4)
Web development basics (Part-4)Web development basics (Part-4)
Web development basics (Part-4)
Rajat Pratap Singh
 
Introduction to Javascript programming
Introduction to Javascript programmingIntroduction to Javascript programming
Introduction to Javascript programming
Fulvio Corno
 
Web development basics (Part-7)
Web development basics (Part-7)Web development basics (Part-7)
Web development basics (Part-7)
Rajat Pratap Singh
 
JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - Introduction
WebStackAcademy
 
Back to the future: Isomorphic javascript applications
Back to the future:  Isomorphic javascript applicationsBack to the future:  Isomorphic javascript applications
Back to the future: Isomorphic javascript applications
Luciano Colosio
 
Javascript
JavascriptJavascript
Javascript
Vibhor Grover
 
Before you jump into Angular
Before you jump into AngularBefore you jump into Angular
Before you jump into Angular
M A Hossain Tonu
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Marlon Jamera
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript Programming
Raveendra R
 
JavaScript operators
JavaScript operatorsJavaScript operators
JavaScript operators
Vivek Kumar
 
Web development basics (Part-6)
Web development basics (Part-6)Web development basics (Part-6)
Web development basics (Part-6)
Rajat Pratap Singh
 
Java Script ppt
Java Script pptJava Script ppt
Java Script ppt
Priya Goyal
 
Variables in Pharo5
Variables in Pharo5Variables in Pharo5
Variables in Pharo5
Marcus Denker
 
Javascript Basics
Javascript BasicsJavascript Basics
Javascript Basics
Vishal Mittal
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond Smalltak
Marcus Denker
 
Web development basics (Part-3)
Web development basics (Part-3)Web development basics (Part-3)
Web development basics (Part-3)
Rajat Pratap Singh
 
Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)
Rajat Pratap Singh
 
Introduction To JavaScript
Introduction To JavaScriptIntroduction To JavaScript
Introduction To JavaScript
Reema
 
vb script
vb scriptvb script
vb script
Anand Dhana
 
Web development basics (Part-4)
Web development basics (Part-4)Web development basics (Part-4)
Web development basics (Part-4)
Rajat Pratap Singh
 
Introduction to Javascript programming
Introduction to Javascript programmingIntroduction to Javascript programming
Introduction to Javascript programming
Fulvio Corno
 
Web development basics (Part-7)
Web development basics (Part-7)Web development basics (Part-7)
Web development basics (Part-7)
Rajat Pratap Singh
 
JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - Introduction
WebStackAcademy
 
Back to the future: Isomorphic javascript applications
Back to the future:  Isomorphic javascript applicationsBack to the future:  Isomorphic javascript applications
Back to the future: Isomorphic javascript applications
Luciano Colosio
 
Before you jump into Angular
Before you jump into AngularBefore you jump into Angular
Before you jump into Angular
M A Hossain Tonu
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Marlon Jamera
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript Programming
Raveendra R
 
JavaScript operators
JavaScript operatorsJavaScript operators
JavaScript operators
Vivek Kumar
 
Web development basics (Part-6)
Web development basics (Part-6)Web development basics (Part-6)
Web development basics (Part-6)
Rajat Pratap Singh
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond Smalltak
Marcus Denker
 
Web development basics (Part-3)
Web development basics (Part-3)Web development basics (Part-3)
Web development basics (Part-3)
Rajat Pratap Singh
 
Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)
Rajat Pratap Singh
 
Introduction To JavaScript
Introduction To JavaScriptIntroduction To JavaScript
Introduction To JavaScript
Reema
 

Similar to Intro to JavaScript - Thinkful LA, June 2017 (20)

Java script
Java scriptJava script
Java script
Sukrit Gupta
 
Lect-5--JavaScript-Intro-12032024-105816am.pptx
Lect-5--JavaScript-Intro-12032024-105816am.pptxLect-5--JavaScript-Intro-12032024-105816am.pptx
Lect-5--JavaScript-Intro-12032024-105816am.pptx
zainm7032
 
Introduction to JAVA SCRIPT USING HTML and CSS
Introduction to JAVA SCRIPT USING HTML and CSSIntroduction to JAVA SCRIPT USING HTML and CSS
Introduction to JAVA SCRIPT USING HTML and CSS
ManasaMR2
 
Build a game with javascript (april 2017)
Build a game with javascript (april 2017)Build a game with javascript (april 2017)
Build a game with javascript (april 2017)
Thinkful
 
Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)
Thinkful
 
JavaScript Interview Questions Part - 1.pdf
JavaScript Interview Questions Part - 1.pdfJavaScript Interview Questions Part - 1.pdf
JavaScript Interview Questions Part - 1.pdf
katarichallenge
 
Journey To The Front End World - Part3 - The Machine
Journey To The Front End World - Part3 - The MachineJourney To The Front End World - Part3 - The Machine
Journey To The Front End World - Part3 - The Machine
Irfan Maulana
 
Welcome to React.pptx
Welcome to React.pptxWelcome to React.pptx
Welcome to React.pptx
PraveenKumar680401
 
JavaScript : A trending scripting language
JavaScript : A trending scripting languageJavaScript : A trending scripting language
JavaScript : A trending scripting language
AbhayDhupar
 
Java script
Java scriptJava script
Java script
Sadeek Mohammed
 
Javascript pdf for beginners easy levell
Javascript pdf for beginners easy levellJavascript pdf for beginners easy levell
Javascript pdf for beginners easy levell
SakshamGupta957136
 
Java Script basics and DOM
Java Script basics and DOMJava Script basics and DOM
Java Script basics and DOM
Sukrit Gupta
 
Final Java-script.pptx
Final Java-script.pptxFinal Java-script.pptx
Final Java-script.pptx
AlkanthiSomesh
 
Java script
Java scriptJava script
Java script
Abhishek Kesharwani
 
WT Unit-3 PPT.pptx
WT Unit-3 PPT.pptxWT Unit-3 PPT.pptx
WT Unit-3 PPT.pptx
TusharTikia
 
Javascript Basics by Bonny
Javascript Basics by BonnyJavascript Basics by Bonny
Javascript Basics by Bonny
Bonny Chacko
 
Gwt.Create Keynote San Francisco
Gwt.Create Keynote San FranciscoGwt.Create Keynote San Francisco
Gwt.Create Keynote San Francisco
Ray Cromwell
 
Learning space presentation1 learn Java script
Learning space presentation1 learn Java scriptLearning space presentation1 learn Java script
Learning space presentation1 learn Java script
engmk83
 
Iwt note(module 2)
Iwt note(module 2)Iwt note(module 2)
Iwt note(module 2)
SANTOSH RATH
 
concept of server-side JavaScript / JS Framework: NODEJS
concept of server-side JavaScript / JS Framework: NODEJSconcept of server-side JavaScript / JS Framework: NODEJS
concept of server-side JavaScript / JS Framework: NODEJS
Kongu Engineering College, Perundurai, Erode
 
Lect-5--JavaScript-Intro-12032024-105816am.pptx
Lect-5--JavaScript-Intro-12032024-105816am.pptxLect-5--JavaScript-Intro-12032024-105816am.pptx
Lect-5--JavaScript-Intro-12032024-105816am.pptx
zainm7032
 
Introduction to JAVA SCRIPT USING HTML and CSS
Introduction to JAVA SCRIPT USING HTML and CSSIntroduction to JAVA SCRIPT USING HTML and CSS
Introduction to JAVA SCRIPT USING HTML and CSS
ManasaMR2
 
Build a game with javascript (april 2017)
Build a game with javascript (april 2017)Build a game with javascript (april 2017)
Build a game with javascript (april 2017)
Thinkful
 
Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)
Thinkful
 
JavaScript Interview Questions Part - 1.pdf
JavaScript Interview Questions Part - 1.pdfJavaScript Interview Questions Part - 1.pdf
JavaScript Interview Questions Part - 1.pdf
katarichallenge
 
Journey To The Front End World - Part3 - The Machine
Journey To The Front End World - Part3 - The MachineJourney To The Front End World - Part3 - The Machine
Journey To The Front End World - Part3 - The Machine
Irfan Maulana
 
JavaScript : A trending scripting language
JavaScript : A trending scripting languageJavaScript : A trending scripting language
JavaScript : A trending scripting language
AbhayDhupar
 
Javascript pdf for beginners easy levell
Javascript pdf for beginners easy levellJavascript pdf for beginners easy levell
Javascript pdf for beginners easy levell
SakshamGupta957136
 
Java Script basics and DOM
Java Script basics and DOMJava Script basics and DOM
Java Script basics and DOM
Sukrit Gupta
 
Final Java-script.pptx
Final Java-script.pptxFinal Java-script.pptx
Final Java-script.pptx
AlkanthiSomesh
 
WT Unit-3 PPT.pptx
WT Unit-3 PPT.pptxWT Unit-3 PPT.pptx
WT Unit-3 PPT.pptx
TusharTikia
 
Javascript Basics by Bonny
Javascript Basics by BonnyJavascript Basics by Bonny
Javascript Basics by Bonny
Bonny Chacko
 
Gwt.Create Keynote San Francisco
Gwt.Create Keynote San FranciscoGwt.Create Keynote San Francisco
Gwt.Create Keynote San Francisco
Ray Cromwell
 
Learning space presentation1 learn Java script
Learning space presentation1 learn Java scriptLearning space presentation1 learn Java script
Learning space presentation1 learn Java script
engmk83
 
Iwt note(module 2)
Iwt note(module 2)Iwt note(module 2)
Iwt note(module 2)
SANTOSH RATH
 

More from Thinkful (20)

893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-25-46-115-141-308-324-370
893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-25-46-115-141-308-324-370893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-25-46-115-141-308-324-370
893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-25-46-115-141-308-324-370
Thinkful
 
LA 1/31/18 Intro to JavaScript: Fundamentals
LA 1/31/18 Intro to JavaScript: FundamentalsLA 1/31/18 Intro to JavaScript: Fundamentals
LA 1/31/18 Intro to JavaScript: Fundamentals
Thinkful
 
LA 1/31/18 Intro to JavaScript: Fundamentals
LA 1/31/18 Intro to JavaScript: FundamentalsLA 1/31/18 Intro to JavaScript: Fundamentals
LA 1/31/18 Intro to JavaScript: Fundamentals
Thinkful
 
Itjsf129
Itjsf129Itjsf129
Itjsf129
Thinkful
 
Twit botsd1.30.18
Twit botsd1.30.18Twit botsd1.30.18
Twit botsd1.30.18
Thinkful
 
Build your-own-instagram-filters-with-javascript-202-335 (1)
Build your-own-instagram-filters-with-javascript-202-335 (1)Build your-own-instagram-filters-with-javascript-202-335 (1)
Build your-own-instagram-filters-with-javascript-202-335 (1)
Thinkful
 
Baggwjs124
Baggwjs124Baggwjs124
Baggwjs124
Thinkful
 
Become a Data Scientist: A Thinkful Info Session
Become a Data Scientist: A Thinkful Info SessionBecome a Data Scientist: A Thinkful Info Session
Become a Data Scientist: A Thinkful Info Session
Thinkful
 
Vpet sd-1.25.18
Vpet sd-1.25.18Vpet sd-1.25.18
Vpet sd-1.25.18
Thinkful
 
LA 1/18/18 Become A Web Developer: A Thinkful Info Session
LA 1/18/18 Become A Web Developer: A Thinkful Info SessionLA 1/18/18 Become A Web Developer: A Thinkful Info Session
LA 1/18/18 Become A Web Developer: A Thinkful Info Session
Thinkful
 
How to Choose a Programming Language
How to Choose a Programming LanguageHow to Choose a Programming Language
How to Choose a Programming Language
Thinkful
 
Batbwjs117
Batbwjs117Batbwjs117
Batbwjs117
Thinkful
 
1/16/18 Intro to JS Workshop
1/16/18 Intro to JS Workshop1/16/18 Intro to JS Workshop
1/16/18 Intro to JS Workshop
Thinkful
 
LA 1/16/18 Intro to Javascript: Fundamentals
LA 1/16/18 Intro to Javascript: FundamentalsLA 1/16/18 Intro to Javascript: Fundamentals
LA 1/16/18 Intro to Javascript: Fundamentals
Thinkful
 
(LA 1/16/18) Intro to JavaScript: Fundamentals
(LA 1/16/18) Intro to JavaScript: Fundamentals(LA 1/16/18) Intro to JavaScript: Fundamentals
(LA 1/16/18) Intro to JavaScript: Fundamentals
Thinkful
 
Websitesd1.15.17.
Websitesd1.15.17.Websitesd1.15.17.
Websitesd1.15.17.
Thinkful
 
Bavpwjs110
Bavpwjs110Bavpwjs110
Bavpwjs110
Thinkful
 
Byowwhc110
Byowwhc110Byowwhc110
Byowwhc110
Thinkful
 
Getting started-jan-9-2018
Getting started-jan-9-2018Getting started-jan-9-2018
Getting started-jan-9-2018
Thinkful
 
Introjs1.9.18tf
Introjs1.9.18tfIntrojs1.9.18tf
Introjs1.9.18tf
Thinkful
 
893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-25-46-115-141-308-324-370
893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-25-46-115-141-308-324-370893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-25-46-115-141-308-324-370
893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-25-46-115-141-308-324-370
Thinkful
 
LA 1/31/18 Intro to JavaScript: Fundamentals
LA 1/31/18 Intro to JavaScript: FundamentalsLA 1/31/18 Intro to JavaScript: Fundamentals
LA 1/31/18 Intro to JavaScript: Fundamentals
Thinkful
 
LA 1/31/18 Intro to JavaScript: Fundamentals
LA 1/31/18 Intro to JavaScript: FundamentalsLA 1/31/18 Intro to JavaScript: Fundamentals
LA 1/31/18 Intro to JavaScript: Fundamentals
Thinkful
 
Twit botsd1.30.18
Twit botsd1.30.18Twit botsd1.30.18
Twit botsd1.30.18
Thinkful
 
Build your-own-instagram-filters-with-javascript-202-335 (1)
Build your-own-instagram-filters-with-javascript-202-335 (1)Build your-own-instagram-filters-with-javascript-202-335 (1)
Build your-own-instagram-filters-with-javascript-202-335 (1)
Thinkful
 
Baggwjs124
Baggwjs124Baggwjs124
Baggwjs124
Thinkful
 
Become a Data Scientist: A Thinkful Info Session
Become a Data Scientist: A Thinkful Info SessionBecome a Data Scientist: A Thinkful Info Session
Become a Data Scientist: A Thinkful Info Session
Thinkful
 
Vpet sd-1.25.18
Vpet sd-1.25.18Vpet sd-1.25.18
Vpet sd-1.25.18
Thinkful
 
LA 1/18/18 Become A Web Developer: A Thinkful Info Session
LA 1/18/18 Become A Web Developer: A Thinkful Info SessionLA 1/18/18 Become A Web Developer: A Thinkful Info Session
LA 1/18/18 Become A Web Developer: A Thinkful Info Session
Thinkful
 
How to Choose a Programming Language
How to Choose a Programming LanguageHow to Choose a Programming Language
How to Choose a Programming Language
Thinkful
 
Batbwjs117
Batbwjs117Batbwjs117
Batbwjs117
Thinkful
 
1/16/18 Intro to JS Workshop
1/16/18 Intro to JS Workshop1/16/18 Intro to JS Workshop
1/16/18 Intro to JS Workshop
Thinkful
 
LA 1/16/18 Intro to Javascript: Fundamentals
LA 1/16/18 Intro to Javascript: FundamentalsLA 1/16/18 Intro to Javascript: Fundamentals
LA 1/16/18 Intro to Javascript: Fundamentals
Thinkful
 
(LA 1/16/18) Intro to JavaScript: Fundamentals
(LA 1/16/18) Intro to JavaScript: Fundamentals(LA 1/16/18) Intro to JavaScript: Fundamentals
(LA 1/16/18) Intro to JavaScript: Fundamentals
Thinkful
 
Websitesd1.15.17.
Websitesd1.15.17.Websitesd1.15.17.
Websitesd1.15.17.
Thinkful
 
Bavpwjs110
Bavpwjs110Bavpwjs110
Bavpwjs110
Thinkful
 
Byowwhc110
Byowwhc110Byowwhc110
Byowwhc110
Thinkful
 
Getting started-jan-9-2018
Getting started-jan-9-2018Getting started-jan-9-2018
Getting started-jan-9-2018
Thinkful
 
Introjs1.9.18tf
Introjs1.9.18tfIntrojs1.9.18tf
Introjs1.9.18tf
Thinkful
 

Recently uploaded (20)

"Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules""Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules"
rupalinirmalbpharm
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Herbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptxHerbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptx
RAJU THENGE
 
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx   quiz by Ridip HazarikaTHE STG QUIZ GROUP D.pptx   quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
Ridip Hazarika
 
Engage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdfEngage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdf
TechSoup
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Link your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRMLink your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRM
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Sugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptxSugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptx
Dr. Renu Jangid
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Kasdorf "Accessibility Essentials: A 2025 NISO Training Series, Session 5, Ac...
Kasdorf "Accessibility Essentials: A 2025 NISO Training Series, Session 5, Ac...Kasdorf "Accessibility Essentials: A 2025 NISO Training Series, Session 5, Ac...
Kasdorf "Accessibility Essentials: A 2025 NISO Training Series, Session 5, Ac...
National Information Standards Organization (NISO)
 
APM Midlands Region April 2025 Sacha Hind Circulated.pdf
APM Midlands Region April 2025 Sacha Hind Circulated.pdfAPM Midlands Region April 2025 Sacha Hind Circulated.pdf
APM Midlands Region April 2025 Sacha Hind Circulated.pdf
Association for Project Management
 
"Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules""Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules"
rupalinirmalbpharm
 
Herbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptxHerbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptx
RAJU THENGE
 
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx   quiz by Ridip HazarikaTHE STG QUIZ GROUP D.pptx   quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
Ridip Hazarika
 
Engage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdfEngage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdf
TechSoup
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Link your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRMLink your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRM
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Sugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptxSugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptx
Dr. Renu Jangid
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 

Intro to JavaScript - Thinkful LA, June 2017

  • 1. June 2017 Intro to JavaScript WIFI: Cross Campus Events bit.ly/intro-js-la
  • 2. About us We train developers and data scientists through 1-on-1 mentorship and career prep
  • 3. About me • Brendan Barr • Full-stack JavaScript developer • LA-based Thinkful mentor
  • 4. About you • What are your programming goals? • I’d like to become a developer • I have an idea I’d like to build • I’d like to work better with developer • What is your programming experience? • First lines of code will be written tonight! • Been self-teaching for 1-3 months • Been at this for longer than 3 months
  • 5. Format for tonight • Basics of how the web works • Background about Javascript • Review key Javascript concepts • Practice with some challenges • Next steps to continue learning
  • 6. Before we get started… • Chrome Developer Tools provides an interactive JavaScript console, where you can run and debug code: • View -> Developer -> JavaScript console • Shortcut: option-command-J on a Mac; Ctrl + Shift + J on a PC • Type the following command and hit enter: alert(“Hello world!”); • Type: 2+2;
  • 7. What is programming? Programming is writing instructions for a computer to execute. Programming is problem-solving.
  • 8. How the web works Type a URL from a client (e.g. facebook.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
  • 9. Clients / Servers Client (sends requests) Frontend Developer Manages what user sees Server (sends response) Backend Developer Manage what app does
  • 10. 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
  • 11. Brief history of Javascript • Written by Brendan Eich in 1995 for Netscape • Initial version written in 10 days • Completely unrelated to Java, named as a marketing stunt because Java was “hot” at the time • Continues to evolve under guidance of ECMA International, driven by browser makers
  • 12. Javascript today JavaScript is the most commonly used programming language on earth. Even Back- End developers are more likely to use it than any other language.
  • 13. 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
  • 14. 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!
  • 15. Concepts we’ll cover • Variables • Data types: strings, numbers, booleans • Functions
  • 16. 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
  • 17. 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
  • 18. Examples • Declaring variable: var firstVariable; • Assigning value: firstVariable = 6; • Retrieve value: alert(firstVariable) Example on JSBin: http://bit.ly/js-example-two
  • 19. 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
  • 20. What values can be assigned to a variable? • String • Number • Boolean • Also Null, Undefined, Arrays, and Objects
  • 21. 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”;
  • 22. 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
  • 23. 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
  • 24. 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;
  • 25. Quick challenge • Open JSBin • Store two numbers in two different variables • Add the two numbers • Multiply the two numbers
  • 26. Introducing booleans Boolean is just a fancy word for “true” or “false” var loggedIn = true; if (loggedIn == true) { alert(“loggedIn was set to true!”) }
  • 27. 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.
  • 28. Example Declaring a function function doSomething () { alert(“Done!”) } Calling a function doSomething()
  • 29. 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
  • 30. 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
  • 31. 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
  • 32. 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);
  • 33. An example function addTwoNumbers(numberOne, numberTwo) { return numberOne + numberTwo; } var result = addTwoNumbers(2, 3); alert(result);
  • 34. 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
  • 35. Learning to learn • Google is your friend! • Practice at the edge of your abilities • Ignore the hot new thing. Instead go deep with one technology
  • 36. Ways to keep learningLevelofsupport Structure efficiency
  • 37. 1-on-1 mentorship enables flexibility 325+ mentors with an average of 10 years of experience in the field
  • 39. Our results Job Titles after GraduationMonths until Employed
  • 40. 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