Introductions & Objectives
Data Types, Built-In Functions, & Methods
For Loops & the Accumulator Pattern
Q & A
Describe some of the different
data types in JavaScript
Describe & implement the accumulator pattern
Ask questions as they come to you!
Go to repl.it and type in JavaScript
Copy the following into the box on the left
and then hit run (or Command + Enter)
console.log('Hello World!')Programming languages rely upon a variety of data types to perform all kinds of computations
Today we'll cover the following:
Functions are blocks of code that can be reused
Methods are functions that are associated
with an object
Numbers, Strings, and Arrays all have methods
that can be called on them
If that's too complicated,
functions/methods are magic! ✨
What if we have a list where
we don't know the length?
For Loops allow us to make multiple
iterations over a list
You'll find them in all kinds of languages,
including JavaScript
for (var i = 0; i < 5; i++) {
console.log("x")
}
for keyword
starting value of i
i is less than 5
increasing the value of i by 1
do something.
Patterns give us more tools to solve
complex problems we come across
Learning a programming language is
like learning a speaking language