JavaScript - Data Types Flashcards
What are data types in programming?
Classifications we give to the different kinds of data used in programming.
How many fundamental data types are there in JavaScript?
Seven.
What is a Number data type?
Any number, including decimals: 4, 8, 1516, 23.42.
What are the two subgroups of the Number data type?
- Integer
- Float
Define Integer in the context of data types.
A whole number without a decimal point.
Define Float in the context of data types.
A number that contains a decimal point.
What is a String data type?
Any grouping of characters surrounded by single or double quotes.
Which type of quotes is preferred for Strings in JavaScript?
Single quotes.
What is a Boolean data type?
A data type that has two possible values: true or false.
How can you think of Booleans?
As on and off switches or answers to a yes or no question.
What does the Null data type represent?
The intentional absence of a value.
How is Null represented in JavaScript?
By the keyword null.
What does the Undefined data type indicate?
The absence of a value, but it has a different use than null.
How is Undefined represented in JavaScript?
By the keyword undefined.
What is a Symbol in JavaScript?
A unique identifier, useful in more complex coding.
What is an Object data type?
Collections of related data.
Which of the first six data types are considered primitive data types?
Number, String, Boolean, Null, Undefined, Symbol.
What distinguishes Objects from primitive data types?
Objects are more complex.