/
AI Flashcards
Save to my account
Sign up
AI Flashcards
JavaScript Fundamentals
Study
1
Question
What is JavaScript primarily used for in web development?
Page 1
Answer
Provides client-side behavior and logic for 99% of websites, making them interesting, interactive, and adjustable.
2
Question
How does JavaScript relate to HTML and CSS?
Page 1
Answer
JavaScript is a programming language like HTML and CSS.
3
Question
What role do variables play in JavaScript code?
Page 1
Answer
Variables store data or information.
4
Question
Give an example of data stored in a variable like a username.
Page 1
Answer
Your username.
5
Question
What kind of data might a variable store for the price of a single t-shirt?
Page 1
Answer
The price of a single t-shirt.
6
Question
What variable could store whether a user is logged into an account?
Page 1
Answer
Whether or not the user is logged into an account.
7
Question
What irrational number is often stored in a variable for math calculations?
Page 1
Answer
The irrational number pi.
8
Question
What player-related data might a variable hold in a video game?
Page 1
Answer
The player character that will show up in a video game.
9
Question
What list of points counts as a player's hitbox in a game variable?
Page 1
Answer
A list of all the points that counts as the player's hitbox in a game.
10
Question
What do data types refer to in variables?
Page 1
Answer
The type of data that is being stored.
11
Question
Why is the number 2 different from the symbol "2" in data types?
Page 1
Answer
They are different types stored differently in memory.
12
Question
What are integers in JavaScript?
Page 1
Answer
Whole numbers, positive or negative.
13
Question
Name three examples of integer values.
Page 1
Answer
• 4 • -35 • 0
14
Question
What are doubles in JavaScript data types?
Page 1
Answer
Decimal numbers, positive or negative.
15
Question
Name two examples of double values.
Page 1
Answer
• 3.14 • -8.1845
16
Question
What is a string data type?
Page 1
Answer
A series of characters in a particular order, like a word or phrase.
17
Question
Give two examples of string values.
Page 1
Answer
• "Hello" • "Bob Cat"
18
Question
What values does a Boolean data type hold?
Page 1
Answer
Yes or no values, always written as "true" or "false".
19
Question
Name the two Boolean values.
Page 1
Answer
• true • false
20
Question
What is a List/Array data type?
Page 1
Answer
An array of related values.
21
Question
Give an example of a List/Array.
Page 1
Answer
[A, B, C...]
22
Question
What is an Object data type?
Page 1
Answer
A collection of related values.
23
Question
How should you read JavaScript code?
Page 4
Answer
Read all code from top to bottom for the order.
24
Question
What does 'let name = "Obama";' declare?
Page 4
Answer
A variable named 'name' with value "Obama".
25
Question
What does print("Thanks") output?
Page 4
Answer
Thanks
26
Question
If name = "Obama", what does print(name) output?
Page 4
Answer
Obama
27
Question
What is the full output of code: let name = "Obama"; print("Thanks"); print(name);
Page 4
Answer
• Thanks • Obama
28
Question
Are semicolons required at the end of lines in this JS?
Page 4
Answer
No, you can omit/ignore them as long as you write code on new lines.
29
Question
Why form a habit of using semicolons in JS?
Page 4
Answer
Prepares for AP Comp Sci A which requires them.
30
Question
What is the default display command in generic JS?
Page 4
Answer
console.log(THING_TO_DISPLAY)