The weirdest part of JavaScript

28733273eda487af5bc13dce8b288ce5?s=47 King Rayhan
January 15, 2020

The weirdest part of JavaScript

28733273eda487af5bc13dce8b288ce5?s=128

King Rayhan

January 15, 2020
Tweet

Transcript

  1. 1.
  2. 2.
  3. 3.

    Statically typed means the type is enforced and won’t change

    so easily. All variables must be declared with a type. JS is not statically typed unless you’re using a language, tool such as Typescript or Flow that compiles to JS code.
  4. 4.
  5. 5.
  6. 6.

    Declares variable types at runtime This means once your code

    is run the compiler/interpreter will see your variable and its value then decide what type it is. The type is still enforced here, it just decides what the type is.
  7. 7.
  8. 8.
  9. 9.
  10. 11.

    — true or false — no value — a declared

    variable but hasn’t been given a value — integers, floats, etc — an array of characters i.e words — a unique value that's not equal to any other value
  11. 12.
  12. 13.
  13. 14.
  14. 15.
  15. 16.
  16. 17.
  17. 18.
  18. 19.
  19. 20.

    Every primitive has a constructor or parent object. JS knows

    when you’re trying to access a method on a primitive and behind the scenes, it will use the constructor to make an object out of your primitive. Once it runs the method that object is then garbage collected. ( Removed from memory )
  20. 21.