JavaScript Midterm

studied byStudied by 5 people
5.0(1)
get a hint
hint

What is the difference between HTML, CSS and JavaScript?

1 / 31

Studying Progress

0%
New cards
32
Still learning
0
Almost done
0
Mastered
0
32 Terms
1
New cards

What is the difference between HTML, CSS and JavaScript?

HTML=structure/framework

CSS=design

JavaScript=interactive features

New cards
2
New cards

How does the computer interpret the world through code?

Uses a model of an object; object-oriented programing

New cards
3
New cards

Describe objects:

*objects are things:

-they have properties, events, and methods

-properties+events+methods=object

New cards
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

New cards
5
New cards

Describe methods:

*how people interact with objects

-second part of the code after period (member operator)

New cards
6
New cards

Identify the event and method

document.write(‘Good afternoon!’)

   event                 method

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

document.write(‘Good afternoon!’)

New cards
7
New cards

Describe how computers interpret the code:

Events trigger methods and methods retrieve or update an objects properties

New cards
8
New cards

Describe variables

store temporary bits of information to perform a task

New cards
9
New cards

Identify the variable and name

var boldColor | let boldColor

variable name

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

var boldColor

New cards
10
New cards

what are the variable keywords?

var

let

const

New cards
11
New cards

how do you declare a variable?

give it a name (identifier)

New cards
12
New cards

describe value

data that is stored within the variable

a value must be assigned to a variable

New cards
13
New cards

What are the different data types?

Numeric, strings, boolean

New cards
14
New cards

Describe the numeric data types

can be decimals or negative numbers

cannot have commas

New cards
15
New cards

describe strings

consist of letters and characters

add content to a page

always within ‘single’ or “double” quotation marks

New cards
16
New cards

describe booleans

can only have 1 of 2 values, true or false

New cards
17
New cards

describe arrays

a special type of variable that stores a list of values

New cards
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’

New cards
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’]

New cards
20
New cards

describe expressions

result in a single value

New cards
21
New cards

describe operators

used to create a single value from one or more values

New cards
22
New cards

what are the 4 different operators?

assignment (=)

string (+)

logical (&&)

comparison (> | <)

New cards
23
New cards

what is the assignment operator

=

assigns a value to a variable

New cards
24
New cards

what is the string operator

+

combines two strings

New cards
25
New cards

what is the logical operator

&&

combines expressions as true or false (boolean)

New cards
26
New cards

what is the comparison operator

<

compares values

New cards
27
<p>explain this script</p>
New cards
<p>explain this script</p>

explain this script

knowt flashcard image
knowt flashcard image
New cards
28
New cards

describe functions

a series of statements that are grouped to perform a task

New cards
29
New cards

describe conditions

conditions determine a path to take

returns a true or false value (boolean)

New cards
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

New cards
31
New cards

describe the DOM

document object model

views and changes the output of HTML without actually changing the original HTML

New cards
32
New cards

what is the entry node of the DOM tree?

document node

New cards

Explore top notes

note Note
studied byStudied by 11 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 27 people
Updated ... ago
5.0 Stars(2)
note Note
studied byStudied by 82 people
Updated ... ago
4.5 Stars(2)
note Note
studied byStudied by 25 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 4 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 3 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 7 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 3377 people
Updated ... ago
4.8 Stars(29)

Explore top flashcards

flashcards Flashcard104 terms
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard33 terms
studied byStudied by 11 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard67 terms
studied byStudied by 125 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard80 terms
studied byStudied by 1 person
Updated ... ago
4.0 Stars(1)
flashcards Flashcard100 terms
studied byStudied by 27 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard42 terms
studied byStudied by 72 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard70 terms
studied byStudied by 20 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard311 terms
studied byStudied by 80 people
Updated ... ago
5.0 Stars(1)