Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The weirdest part of JavaScript

King Rayhan
January 15, 2020

The weirdest part of JavaScript

King Rayhan

January 15, 2020
Tweet

More Decks by King Rayhan

Other Decks in Education

Transcript

  1. 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.
  2. 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.
  3. — 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
  4. 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 )