JavaScript theory Flashcards

1
Q

Set

A

A set is an unordered collection of elements without duplicate entries.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is javascript

A

This is what makes your site interactive and your website feel like an app

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

sets are used for

A

membership testing (if a specific element belongs to the set) and eliminating duplicate entries.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

list comprehension

A

a way to create a new list with less syntax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Iterable

A

object that can be iterated (repeated) or looped over.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what does alert keyword do

A

pop up to gives user a message

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

text string

A

string or message enclosed in quotes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

is semicolon needed in js

A

In JavaScript, the use of semicolons at the end of statements is generally optional, but it is considered a best practice to include them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is a statement

A

instructions that are executed by the browser

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is a variable

A

a word that refers to a particular value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Variables takes on a particular value when you _______ the value to it

A

assign

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

in alert if you have a number it is automatically converted to a string and displays it

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Wherever you can use a number, you can use a _____ expression.

A

math

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

for n++ When the pluses come after the variable, its original value is assigned to the new variable __when____ the incrementing variable is incremented.

A

before

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what can you use to eliminate ambiguity in math expressions

A

parentheses ( )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Using the plus operator, the code combines—_________—three elements into the
message:

A

concatenates

17
Q

if string message and number are concatenated using the + sign, what happens to the number in here

A

they are automatically converted from numbers to strings.

18
Q

A ___ box asks the user for some information and provides a response field for her
answer.

A

prompt

19
Q

To capture the user’s response you need to start by declaring a ___

A

variable

20
Q

in prompt if the user enter a number what will happen

A

its converted to a string automatically

21
Q

In prompt, If the user enters nothing and clicks OK, the variable is assigned

A

an empty string: “ “

22
Q

In prompt, If the user clicks Cancel, the variable is assigned

A

a special value, null.

23
Q

what is null

A

intentional absence of value - indicate that a variable or object property does not currently point to any meaningful value.

24
Q

what is empty string

A

a string with zero characters - used when you need a string data type, but there’s no actual textual content.

25
Q

for an if statement the condition is enclosed in

A

parentheses ( )

26
Q

just an equal = sign is reserved for

A

assigning values to a variable

27
Q
A