| type |
content |
super-big-text |
**JavaScript intro**
|
|
| content |
notes |
## JavaScript ≠ Java
*Two completely different programming languages*
|
When searching for answers **do not** search for Java—you’ll get confusing results because the Java programming language is *completely different* from JavaScript.
|
|
| type |
image |
notes |
image |
layer-3.svg |
Remember the “Peanut M&M” analogy? Well we’ve so far only talked about the peanut (HTML/content) & the chocolate (CSS/design), now we’re going to talk about the candy: JavaScript.
JS isn’t necessary for a website (a chocolate covered peanut is still quite delicious) but depends completely on CSS & HTML to function.
|
|
| content |
## Complete control
- Complete control over your HTML & CSS
- You can manipulate it any way you want
- Adds more features that you can’t normally access
|
|
| content |
## Think like a computer
- JavaScript is a legit programming language
- You need to start thinking like a computer
- Computers only do exactly what you ask them
|
|
| content |
## A new syntax
- `variable` — a box that holds something
- `if-statement` — branches our code 1 of 2 ways
- `loop` — repeats our code a number of time
- `switch` — multiple branches
|
|
| content |
## Variable contents
- `string` — just some text, surrounded in ''
- `number` — just a number, no quotes
- `boolean` — `true` or `false`
- `array` — a collection, like `<ol>`
- `object` — a named collection, like `<dl>`
- `function` — a piece of re-usable code
|
|
| content |
## Videos & tutorials
- [JavaScript syntax ➔](/topics/javascript-syntax/)
- [JavaScript validator ➔](/topics/validators/#validating-javascript)
- [JavaScript cheat sheet ➔](/topics/javascript-cheat-sheet/)
|
|