JavaScript Midterm

5.0(4)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/31

flashcard set

Earn XP

Description and Tags

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

32 Terms

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

CSS=design

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

\-they have properties, events, and methods

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

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

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

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

document.write(ā€˜Good afternoon!ā€™)
\
   event                 method

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

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

var boldColor | let boldColor
variable name

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

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

let

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

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

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

add content to a page

always within ā€˜singleā€™ or ā€œdoubleā€ quotation marks
16
New cards
describe booleans
can only have 1 of 2 values, true or false
17
New cards
describe arrays
a special type of variable that stores a list of values
18
New cards
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ā€™
19
New cards
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ā€™\]
20
New cards
describe expressions
result in a single value
21
New cards
describe operators
used to create a single value from one or more values
22
New cards
what are the 4 different operators?
assignment (=)

string (+)

logical (&&)

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

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

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

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

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

returns a true or false value (boolean)
30
New cards
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
31
New cards
describe the DOM
document object model

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