SlideShare una empresa de Scribd logo
1 de 40
Descargar para leer sin conexión
Intro to JavaScript
June 2017
bit.ly/tf-intro-js
About me
• Tyler Brewer
• Software Developer at Excella
Consulting & Mentor at
Thinkful
• Thinkful Grad
About TAs
• David Coulter
• Program Manager, Thinkful DC
• Formerly National Geographic,
FEMA, other stuff
• Brittany Walker
• Current Thinkful Student
• Super awesome
About you
• What’s your name?
• Why are you interested in learning JS?
About us
We train developers and data
scientists through 1-on-1
mentorship and career prep
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
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
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 and log to console
• Multiply the two numbers and log to console
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!
• Learn HTML/CSS and
JavaScript
• Continue with Node,
React, and more
• We offer both Web
Development and
Data Science
Bootcamps
• Talk to some one
from Thinkful if
you’re interested!

Más contenido relacionado

La actualidad más candente

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
Introduction To JavaScriptIntroduction To JavaScript
Introduction To JavaScriptReema
 
Introduction to Javascript programming
Introduction to Javascript programmingIntroduction to Javascript programming
Introduction to Javascript programmingFulvio Corno
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScriptMarlon Jamera
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced JavascriptDhruvin Shah
 
Web development basics (Part-7)
Web development basics (Part-7)Web development basics (Part-7)
Web development basics (Part-7)Rajat Pratap Singh
 
JavaScript operators
JavaScript operatorsJavaScript operators
JavaScript operatorsVivek Kumar
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript ProgrammingRaveendra R
 
Xtend - better java with -less- noise
Xtend - better java with -less- noiseXtend - better java with -less- noise
Xtend - better java with -less- noiseNeeraj Bhusare
 
Before you jump into Angular
Before you jump into AngularBefore you jump into Angular
Before you jump into AngularM A Hossain Tonu
 
JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - IntroductionWebStackAcademy
 
Introduction to Javascript By Satyen
Introduction to Javascript By  SatyenIntroduction to Javascript By  Satyen
Introduction to Javascript By SatyenSatyen Pandya
 

La actualidad más candente (20)

Web development basics (Part-4)
Web development basics (Part-4)Web development basics (Part-4)
Web development basics (Part-4)
 
Javascript
JavascriptJavascript
Javascript
 
Introduction To JavaScript
Introduction To JavaScriptIntroduction To JavaScript
Introduction To JavaScript
 
Introduction to Javascript programming
Introduction to Javascript programmingIntroduction to Javascript programming
Introduction to Javascript programming
 
JS - Basics
JS - BasicsJS - Basics
JS - Basics
 
Javascript 01 (js)
Javascript 01 (js)Javascript 01 (js)
Javascript 01 (js)
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Variables in Pharo5
Variables in Pharo5Variables in Pharo5
Variables in Pharo5
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
 
Web development basics (Part-7)
Web development basics (Part-7)Web development basics (Part-7)
Web development basics (Part-7)
 
JavaScript operators
JavaScript operatorsJavaScript operators
JavaScript operators
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript Programming
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript Programming
 
Xtend - better java with -less- noise
Xtend - better java with -less- noiseXtend - better java with -less- noise
Xtend - better java with -less- noise
 
Javascript
JavascriptJavascript
Javascript
 
Javascript Workshop
Javascript WorkshopJavascript Workshop
Javascript Workshop
 
Before you jump into Angular
Before you jump into AngularBefore you jump into Angular
Before you jump into Angular
 
JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - Introduction
 
Introduction to Javascript By Satyen
Introduction to Javascript By  SatyenIntroduction to Javascript By  Satyen
Introduction to Javascript By Satyen
 
Lecture 2: ES6 / ES2015 Slide
Lecture 2: ES6 / ES2015 SlideLecture 2: ES6 / ES2015 Slide
Lecture 2: ES6 / ES2015 Slide
 

Similar a Intro to javascript (6:27)

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.pdfkatarichallenge
 
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.pptxzainm7032
 
Final Java-script.pptx
Final Java-script.pptxFinal Java-script.pptx
Final Java-script.pptxAlkanthiSomesh
 
Java Script basics and DOM
Java Script basics and DOMJava Script basics and DOM
Java Script basics and DOMSukrit Gupta
 
Getting started with typescript and angular 2
Getting started with typescript  and angular 2Getting started with typescript  and angular 2
Getting started with typescript and angular 2Knoldus Inc.
 
Lotuscript for large systems
Lotuscript for large systemsLotuscript for large systems
Lotuscript for large systemsBill Buchan
 
Gwt.Create Keynote San Francisco
Gwt.Create Keynote San FranciscoGwt.Create Keynote San Francisco
Gwt.Create Keynote San FranciscoRay Cromwell
 
BITM3730Week6.pptx
BITM3730Week6.pptxBITM3730Week6.pptx
BITM3730Week6.pptxMattMarino13
 
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 MachineIrfan Maulana
 
Iwt note(module 2)
Iwt note(module 2)Iwt note(module 2)
Iwt note(module 2)SANTOSH RATH
 

Similar a Intro to javascript (6:27) (20)

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)
 
Java script
Java scriptJava script
Java script
 
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)
 
JavaScript Interview Questions Part - 1.pdf
JavaScript Interview Questions Part - 1.pdfJavaScript Interview Questions Part - 1.pdf
JavaScript Interview Questions Part - 1.pdf
 
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
 
Welcome to React.pptx
Welcome to React.pptxWelcome to React.pptx
Welcome to React.pptx
 
Introduction to C ++.pptx
Introduction to C ++.pptxIntroduction to C ++.pptx
Introduction to C ++.pptx
 
Final Java-script.pptx
Final Java-script.pptxFinal Java-script.pptx
Final Java-script.pptx
 
Java script
Java scriptJava script
Java script
 
Java Script basics and DOM
Java Script basics and DOMJava Script basics and DOM
Java Script basics and DOM
 
Client sidescripting javascript
Client sidescripting javascriptClient sidescripting javascript
Client sidescripting javascript
 
Getting started with typescript and angular 2
Getting started with typescript  and angular 2Getting started with typescript  and angular 2
Getting started with typescript and angular 2
 
Lotuscript for large systems
Lotuscript for large systemsLotuscript for large systems
Lotuscript for large systems
 
Gwt.Create Keynote San Francisco
Gwt.Create Keynote San FranciscoGwt.Create Keynote San Francisco
Gwt.Create Keynote San Francisco
 
BITM3730Week6.pptx
BITM3730Week6.pptxBITM3730Week6.pptx
BITM3730Week6.pptx
 
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
 
Java script
Java scriptJava script
Java script
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Iwt note(module 2)
Iwt note(module 2)Iwt note(module 2)
Iwt note(module 2)
 
Gwtcreatekeynote
GwtcreatekeynoteGwtcreatekeynote
Gwtcreatekeynote
 

Último

Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 

Último (20)

Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 

Intro to javascript (6:27)

  • 1. Intro to JavaScript June 2017 bit.ly/tf-intro-js
  • 2. About me • Tyler Brewer • Software Developer at Excella Consulting & Mentor at Thinkful • Thinkful Grad
  • 3. About TAs • David Coulter • Program Manager, Thinkful DC • Formerly National Geographic, FEMA, other stuff • Brittany Walker • Current Thinkful Student • Super awesome
  • 4. About you • What’s your name? • Why are you interested in learning JS?
  • 5. About us We train developers and data scientists through 1-on-1 mentorship and career prep
  • 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. 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
  • 14. 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
  • 15. 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!
  • 16. Concepts we’ll cover • Variables • Data types: strings, numbers, booleans • Functions
  • 17. 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
  • 18. 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
  • 19. Examples • Declaring variable: var firstVariable; • Assigning value: firstVariable = 6; • Retrieve value: alert(firstVariable) Example on JSBin: http://bit.ly/js-example-two
  • 20. 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
  • 21. What values can be assigned to a variable? • String • Number • Boolean • Also Null, Undefined, Arrays, and Objects
  • 22. 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”;
  • 23. 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
  • 24. 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
  • 25. 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;
  • 26. Quick challenge • Open JSBin • Store two numbers in two different variables • Add the two numbers and log to console • Multiply the two numbers and log to console
  • 27. Introducing booleans Boolean is just a fancy word for “true” or “false” var loggedIn = true; if (loggedIn == true) { alert(“loggedIn was set to true!”) }
  • 28. 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.
  • 29. Example Declaring a function function doSomething() { alert(“Done!”); } Calling a function doSomething();
  • 30. 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
  • 31. 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
  • 32. 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
  • 33. 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);
  • 34. An example function addTwoNumbers(firstNumber, secondNumber) { return firstNumber + secondNumber; } var result = addTwoNumbers(2, 3); alert(result);
  • 35. 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
  • 36. Ways to keep learningLevelofsupport Learning methods
  • 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! • Learn HTML/CSS and JavaScript • Continue with Node, React, and more • We offer both Web Development and Data Science Bootcamps • Talk to some one from Thinkful if you’re interested!