Fireship · @fireship
The JavaScript Survival Guide
Uploaded July 15, 2019 · Length 14:47
Summary
This video teaches the fundamental concepts of JavaScript programming, including how to run code, primitive types, control flow, and error handling, to help developers survive the language's weirder parts.
- javascript survival guide
- javascript fundamentals
- javascript programming
- javascript basics
- javascript control flow
- javascript error handling
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
some people call javascript a virus and
- 0:02
if that's true it means developers are
- 0:04
the host no matter what you label
- 0:05
yourself ads today you have to face the
- 0:07
reality that one day you may join the
- 0:09
hordes of JavaScript developers out
- 0:10
there and when that day comes you need
- 0:12
to be prepared by understanding the
- 0:14
practical fundamental concepts of the
- 0:15
JavaScript programming language today's
- 0:17
video is not about victory it's about
- 0:19
survival welcome to episode 3 of the
- 0:26
full JavaScript course in the last video
- 0:28
we looked at how JavaScript works under
- 0:29
the hood and today we'll look at many of
- 0:31
the fundamental features of the language
- 0:32
as they relate to practical programming
- 0:34
but more importantly I want to help you
- 0:36
survive some of the weirder parts of
- 0:37
JavaScript that might trip you up or
- 0:39
that you might find on an interview
- 0:40
question and many of these concepts like
- 0:42
closures and hoisting can be easily
- 0:44
understood by removing the head or
- 0:46
destroying the brain
- 0:50
chapter 1 where and how do I run my
- 0:53
JavaScript code let's find out by
- 0:54
creating a hello world app open up an
- 0:56
editor like vs code create a file called
- 0:58
index J s and type in console.log hello
- 1:02
world now assuming you have no js'
- 1:04
installed you can run the script
- 1:05
directly on your machine via the command
- 1:07
line we'll have an entire video
- 1:08
dedicated to node.js later in the course
- 1:10
but all you need to know for right now
- 1:12
is that if you type in node index J s in
- 1:14
the command line it will execute the
- 1:16
code in your script so you just wrote a
- 1:18
back-end server side JavaScript
- 1:19
application but when most people think
- 1:21
about J s they're thinking about
- 1:22
browsers and web applications it's
- 1:25
possible to run code in the browser just
- 1:26
like we did from the command line by
- 1:28
opening the developer console in the
- 1:30
previous video we learned that
- 1:31
javascript has an interpreter or JIT
- 1:33
compiler to be precise that will execute
- 1:35
your code when you type it in here but
- 1:36
the browser console is really just a
- 1:38
debugging tool the way that web
- 1:40
applications actually work is they
- 1:41
declare a script tag in an HTML document
- 1:43
we can go ahead and create an index.html
- 1:45
file then we'll add a script tag and set
- 1:48
the source attribute to the JavaScript
- 1:50
file when the browser parses this HTML
- 1:53
file it's going to see the script tag
- 1:54
and then try to load and execute the
- 1:56
script in our case it won't execute the
- 1:58
JavaScript until the document is fully


