JavaScript Midterm

studied byStudied by 11 people
5.0(2)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 31

flashcard set

Earn XP

Description and Tags

32 Terms

1
*What is the difference between HTML, CSS and JavaScript?*
HTML=structure/framework

CSS=design

JavaScript=interactive features
New cards
2
*How does the computer interpret the world through code?*
Uses a model of an object; object-oriented programing
New cards
3
*Describe objects:*
\*objects are things:

\-they have properties, events, and methods

\-properties+events+methods=object
New cards
4
*Describe events:*
\*involve user interactions

\-programmers choose what events trigger a specific section of code

\-scripts can trigger different types of functionality
New cards
5
*Describe methods:* 
\*how people interact with objects

\-second part of the code after period (member operator)
New cards
6
Identify the event and method

document.write(‘Good afternoon!’)
\
   event                 method

|------------| |-----------------------------|

document.write(‘Good afternoon!’)
New cards
7
*Describe how computers interpret the code:*
Events trigger methods and methods retrieve or update an objects properties
New cards
8
Describe variables
store temporary bits of information to perform a task
New cards
9
Identify the variable and name

var boldColor | let boldColor
variable name

|----| |---------|

var boldColor
New cards
10
what are the variable keywords?
var

let

const
New cards
11
how do you declare a variable?
give it a name (identifier)
New cards
12
describe value
data that is stored within the variable

a value must be assigned to a variable
New cards
13
What are the different data types?
Numeric, strings, boolean
New cards
14
Describe the numeric data types
can be decimals or negative numbers

cannot have commas
New cards
15
describe strings
consist of letters and characters

add content to a page

always within ‘single’ or “double” quotation marks
New cards
16
describe booleans
can only have 1 of 2 values, true or false
New cards
17
describe arrays
a special type of variable that stores a list of values
New cards
18
what are the characteristics of an array
always in \[square brackets\] or array()

used for a list or set of values, useful if the number of items will vary

always separated by commas, uses ‘single’ or “double” quotes

index starts with 0

ex:

let stopLight;

stopLight = \[‘yield’, ‘stop’, ‘walk’\];

stopLight\[1\] = ‘go’
New cards
19
describe what is happening in this script

ex:

let stopLight;

stopLight = \[‘yield’, ‘stop’, ‘walk’\];

stopLight\[1\] = ‘go’
stopLight has an index of 1 which would be stop, but it is set equal to go, so stop is being changed to go making the stopLight array \[‘yield’, ’go’, ‘walk’\]
New cards
20
describe expressions
result in a single value
New cards
21
describe operators
used to create a single value from one or more values
New cards
22
what are the 4 different operators?
assignment (=)

string (+)

logical (&&)

comparison (> |
New cards
23
what is the assignment operator
=

assigns a value to a variable
New cards
24
what is the string operator
\+

combines two strings
New cards
25
what is the logical operator
&&

combines expressions as true or false (boolean)
New cards
26
what is the comparison operator
> <

compares values
New cards
27
explain this script
explain this script
knowt flashcard image
New cards
28
describe functions
a series of statements that are grouped to perform a task
New cards
29
describe conditions
conditions determine a path to take

returns a true or false value (boolean)
New cards
30
describe conditional statements
if a condition is met, then a statement is executed

else code executes a different statement (AKA code skips ahead)

if statements compares value to true

else if the value is false
New cards
31
describe the DOM
document object model

views and changes the output of HTML without actually changing the original HTML
New cards
32
what is the entry node of the DOM tree?
document node
New cards
robot