JavaScript Flashcards

1
Q

What is a variable?

A

A variable is a container that stores data

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

Why are variables useful?

A

Variables can store data, and be used multiples times within code

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

What two special characters can a variable begin with?

A

$ and _

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

How do you declare a variable?

A

use the keyword “var”

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

How do you assign a value to a variable?

A

Use the “=”

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

Are variables case sensitive?

A

Yes

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

Which words cannot be used as variable names?

A

keywords such as function, console, etc

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

What is a string?

A

Form of data stored within quotation marks

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

What is the string concatenation operator?

A

’+’

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

What is the difference when it comes to using single or double quotes?

A

No difference

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

How do you use escape quotation characters?

A

need to put a “"

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

What is type coercion?

A

Type coercion is the process of converting one value to another type

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

What is a number in Javascript?

A

Any number

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

What is an arithmetic operator?

A

Any of the operators that perform arithmetic

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

Name four of the arithmetic operators:

A
  1. +
  2. -
  3. *
  4. /
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the order of execution?

A

PEMDAS

17
Q

What is a boolean?

A

A boolean is a primitive data type that is either true or false

18
Q

What is a comparison operator?

A

it is the < or > sign (or the combined signs of ‘or equals to’)

19
Q

What is the difference between undefined and null?

A

Undefined has yet to be defined, while null means that there is no value.

20
Q

What is a function?

A

A function is a block of code that can perform a particular task.

21
Q

Why are functions useful?

A

You can call the function to perform its needed task instead of writing the same code over and over

22
Q

How do you call a function?

A

Write the function name, followed by ();

23
Q

What are the parts of a function definition?

A

function keyword, function name (and parameters if needed), and the code block

24
Q

What is the difference between a parameter and an argument?

A

Argument is the data you pass in, parameter is the data is that is declared when the function is defined