Core JavaScript variable declarations, data types, and operators explained with a short example each.
38 cards · basic cards · AI-written, checked twice. Edit anything.
- What keyword declares a variable with block scope that cannot be reassigned?
- const
- What keyword declares a variable with block scope that can be reassigned?
- let
- What keyword declares a variable with function scope (pre-ES6)?
- var
- What is the primitive data type for text?
- string
- What is the primitive data type for whole and decimal numbers?
- number
- What is the primitive data type with only two values: true or false?
- boolean
- What is the primitive value that represents the absence of any value?
- null
- What is the primitive value assigned to variables that have been declared but not initialized?
- undefined
- What primitive data type represents a unique identifier that cannot be recreated?
- symbol
- What primitive data type represents integers larger than Number.MAX_SAFE_INTEGER?
- bigint
- What operator returns a string indicating the type of a value?
- typeof
- What data structure is an ordered collection accessed by numeric index?
- array
- What data structure is a collection of key-value pairs?
- object
- What syntax allows embedding expressions inside a string using backticks?
- template literals
- How do you join two strings together in JavaScript?
- Use the + operator or += assignment operator, or template literals with ${}