
Variables Review
Presentation
•
Computers
•
7th Grade
•
Practice Problem
•
Medium
Brandi Girtman
Used 9+ times
FREE Resource
9 Slides • 8 Questions
1
JavaScript Review: Variables
2
What is a variable?
A container for storing a value in the computer's memory
Once created, it can be updated repeatedly throughout the program
3
Use the JavaScript keyword var followed by a label and the semi-colon.
How do you create a variable?
💡TIP: The label should describe the variable that you want to store.
4
Use the label, an equal sign, and the value followed by the semi-colon.
How do you assign a value to a variable?
💡TIP: You don't need the var keyword when assigning the value.
The equal sign is called the "assignment operator"
5
Variable Naming Rules
Labels CAN NOT have spaces
Labels CAN NOT start with a number
Capitalization & spelling MUST match
6
Multiple Choice
A variable is used to:
Store a value in memory
Draw a circle
Store a value that does not change
Draw a rectangle
7
Multiple Choice
Which of these is NOT a good name for a variable storing your middle name?
myMiddleName
middleName
x
midNam
8
Multiple Select
What can be stored in a variable?
(choose 4)
background
color
text
number
a sprite
9
Multiple Choice
JavaScript uses the _______ keyword to define variables.
var
variable
vrb
vari
10
When you create a variable AND assign it a value in one line of code.
Initializing a variable
When assigning values, the equal sign
Is not the same as math class
In JavaScript, it sets the value
11
12
Sometimes, you can't see the value of your variable in the program.
One Problem with variables...
Use console.log(label) to show the value of the variable in the console log.
13
Multiple Choice
How would a computer programmer read the following line of code?
var xPosition = 500;
The variable xPosition is equal to 500.
The variable xPosition gets the value of 500.
14
Multiple Choice
How do you use a variable that has been initialized (created & given a value) in your program?
By using a function
By typing its name
By opening a file
15
Fill in the Blanks
Type answer...
16
Multiple Choice
Which line of code is written correctly?
var 2position = 25;
var yPosition = 12
var xPosition = 25;
var shoe size = 10;
17
JavaScript Review: Variables
Show answer
Auto Play
Slide 1 / 17
SLIDE
Similar Resources on Wayground
12 questions
Musik Ansamble
Presentation
•
7th Grade
12 questions
Scale Factors and Scale Drawings
Presentation
•
7th Grade
12 questions
POTENCIACION
Presentation
•
7th Grade
12 questions
Living Things
Presentation
•
KG
12 questions
Mechanical Waves
Presentation
•
7th Grade
13 questions
Frog Dissections
Presentation
•
7th Grade
10 questions
HTML Editors
Presentation
•
7th Grade
10 questions
Internet Safety
Presentation
•
6th Grade
Popular Resources on Wayground
20 questions
STAAR Review Quiz #3
Quiz
•
8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
6 questions
Marshmallow Farm Quiz
Quiz
•
2nd - 5th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
12 questions
What makes Nebraska's government unique?
Quiz
•
4th - 5th Grade
Discover more resources for Computers
20 questions
Revising & Editing practice
Quiz
•
7th Grade
10 questions
Box Plots
Quiz
•
6th - 7th Grade
14 questions
Volume of rectangular prisms
Quiz
•
7th Grade
22 questions
Simple Probability
Quiz
•
7th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
20 questions
genetics vocabulary
Quiz
•
7th Grade
4 questions
Spring Break rest and recharge
Presentation
•
6th - 8th Grade
24 questions
7th grade STAAR Reading Review
Quiz
•
7th Grade