JavaScript

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/9

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

10 Terms

1
New cards

How to know the type of a JS variable?

typeof operator

2
New cards

Data types

  1. Primitive → store a single value

  2. Non-primitive → store multiple and complex values

3
New cards

Primitive data types

  1. String

  2. Number

  3. Bigint → above number limits

  4. Boolean

  5. Undefined → declared but not assigned

  6. Null → Non-existent, invalid value

  7. Symbol → ES6 anonymous, unique value

4
New cards

typeof of primitive types

typeof "John Doe" // Returns "string"
typeof 3.14 // Returns "number"
typeof true // Returns "boolean"
typeof 234567890123456789012345678901234567890n // Returns bigint
typeof undefined // Returns "undefined"
typeof null // Returns "object" (kind of a bug in JavaScript)
typeof Symbol('symbol') // Returns Symbol

5
New cards

Non-primitive types

  1. Object → store collection of data

→ any data type that’s not primitive is an object in JS

6
New cards

Hoisting

default behavior where all var and function declarations are moved on top

<p>default behavior where all var and function declarations are moved on top</p>
7
New cards
8
New cards
9
New cards
10
New cards