Write, mentally evaluate, and store the result of JS expressions
- Describe what a programming language is
- List reasons for learning JavaScript
- Run JavaScript with a REPL
- Use the various types in JavaScript
- Determine the type of something with
typeof
- Perform math with arithmetic operators
- Compare values with comparison operators
- Read/write values from/to a
var
- Write some code that will not be interpreted with a comment
Q: How many programming languages can we name as a class?
Q: What do programming languages solve? A: Many things, depends on the language.
Q: But what is it really? A: A language written for humans to execute commands on a computer
- Let's look at some language examples and infer things about them from the syntax.
Pair up and look at some more code examples on Rosetta Code
Why learn JavaScript?
- Only language natively supported by browsers
- Popularly used on both the client and server for the web
- It is ubiquitous
- Sustained adoption
- Low barrier to entry
- Developed in 10 days in 1995 by Brendan Eich while working for Netscape.
- JavaScript version history
- TC39
- ECMAScript and JavaScript
read–eval–print loop
Using the snippets section of the Chrome Dev Tools.
What are some types you can think of?
JavaScript has 7 types:
string
number
boolean
null
undefined
Object
Symbol
(new in ES2015)
Knowing the types available in JavaScript, what are some things you would want to do directly with them?
+
,-
*
,/
%
++
,--
Play around with arithmetic operators with a partner.
==
,===
(strict)>
,<
,>=
,<=
!=
,!==
Partner up and try some of these comparison operators out. Try them on the same type, different types, etc.
Show the wat video.
When is this important to know about?
var
=
assignment
Play around with variables with a partner.
Have you thought about how you would name variables?
//
/* */
Pair up and find an open source project. Find some interesting comments and discuss them.
- Describe what a programming language is
- List reasons for learning JavaScript
- Run JavaScript with a REPL
- Use the various types in JavaScript
- Determine the type of something with
typeof
- Perform math with arithmetic operators
- Compare values with comparison operators
- Read/write values from/to a
var
- Write some code that will not be interpreted with a comment