Fireship · @fireship

JavaScript in 100 Seconds

Uploaded January 13, 2022 · Length 2:36

JavaScript in 100 Seconds

Summary

javascript basics explained in 100 seconds, including its features and uses.

  • javascript basics
  • javascript features
  • javascript uses
  • programming language
  • web development

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:02

    javascript a high level single threaded

  2. 0:04

    garbage collected interpreted or just in

  3. 0:06

    time compiled prototype-based

  4. 0:07

    multi-paradigm dynamic language with a

  5. 0:09

    non-blocking event loop made famous for

  6. 0:11

    building websites it was created in 1995

  7. 0:14

    in just one week by brendan ike with the

  8. 0:16

    goal of adding an easy to learn

  9. 0:18

    scripting language to the netscape

  10. 0:19

    browser it was originally named mocha

  11. 0:21

    but the genius marketing people of the

  12. 0:23

    time wanted it to sound like that sexy

  13. 0:25

    new java language today it's a fully

  14. 0:27

    featured language that continues to

  15. 0:28

    evolve through the ecmascript standard

  16. 0:30

    it's most well known for building

  17. 0:32

    front-end web applications because it's

  18. 0:34

    the only language other than web

  19. 0:35

    assembly that is natively supported in

  20. 0:37

    browsers however anything that can be

  21. 0:39

    built with javascript will be built with

  22. 0:41

    javascript like server-side applications

  23. 0:43

    with node.js mobile applications with

  24. 0:45

    react native or ionic and desktop apps

  25. 0:47

    with electron it's an interpreted

  26. 0:49

    scripting language but tools like the v8

  27. 0:51

    engine and chromium use a just-in-time

  28. 0:53

    compiler to convert it to machine code

  29. 0:55

    at runtime it's also excellent at

  30. 0:57

    handling i o intensive jobs despite the

  31. 0:59

    fact that it's a single threaded

  32. 1:01

    language made possible by a non-blocking

  33. 1:03

    event loop that can queue up work in the

  34. 1:05

    background without blocking the main

  35. 1:06

    thread to get started create a file

  36. 1:08

    ending in.js your code will start

  37. 1:11

    executing from the global context use

  38. 1:13

    the console to log a value with the

  39. 1:15

    built-in debugger now think about where

  40. 1:17

    you want to run this file is it a

  41. 1:18

    front-end browser or a back-end node.js

  42. 1:20

    server in the browser you can reference

  43. 1:22

    it with a script tag then the browser

  44. 1:24

    will execute it when you open that html

  45. 1:26

    file on a website javascript is often

  46. 1:28

    used to grab an element from the dom

  47. 1:30

    document query selector will grab the

  48. 1:32

    first button then we can assign it to a

  49. 1:34

    variable with either var let or const

  50. 1:36

    var is the og way to do it but is

  51. 1:38

    typically avoided let is for variables

  52. 1:40

    that can be reassigned while const is

  53. 1:42

    for variables that cannot be reassigned

  54. 1:44

    now to make the button interactive we

  55. 1:45

    can add an event listener to it by

  56. 1:47

    defining a function for the on click

  57. 1:49

    event we can use the function keyword

  58. 1:51

    here or the more concise arrow syntax

  59. 1:53

    now the event loop will execute this

  60. 1:55

    function whenever a new click occurs

  61. 1:57

    functions are first class objects to

  62. 1:58

    support functional programming patterns