JavaScript Fundamentals - Part 1

Last Updated on: August 10, 2021 pm

JavaScript Fundamentals - Part 1

let, var & const

  • let - block scoped
  • var - function scoped

Strings and Template Literals

Use back-ticks always

1
const str = `I am ${firstName}`;

Types Conversion and Coercion

Conversion

Explicitly

Coercion

Implicitly

Falsy and Truthy Values

  • 0
  • undefined
  • '' empty string

Equality Operator “==“ vs “===”

Strict Equality

=== does NOT perform Type Coercion.

1
2
> '18' === 18
> false

Loose Equality

== does Type Coercion.

1
2
> '18' == 18
> true