Javascript-primitives-and-variables Flashcards

1
Q

What is the purpose of variables?

A

give data permeance and something that we can look back at the data in the future.

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

How do you declare a variable?

A

using (var)

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

How do you initialize (assign a value to) a variable?

A

using the variable name and use = (equal sign) or using some assignment operator followed by a value.

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

What characters are allowed in variable names?

A

(no numbers in the beginning), no special characters except: $, and _

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

What does it mean to say that variable names are “case sensitive”?

A

very strict, everything needs to be exact! (lower case needs to be lower cased, and upper case needs to be used with upper cased!).

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

What is the purpose of a string?

A

To store characters (ie user’s username, etc…)

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

What is the purpose of a number?

A

To count, do math, and numerical data

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

What is the purpose of a boolean?

A

To use it for making decisions

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

What does the = operator mean in JavaScript?

A

to assign values into variables.

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

How do you update the value of a variable?

A

place new value and use the = to pertaining variable name. (except using Var).

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

What is the difference between null and undefined?

A

null (intentional/ from developers) is purposeful but undefined (from computer) is something that has no argument.

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

Why is it a good habit to include “labels” when you log values to the browser console?

A
  1. To see where log is coming from

2. Its easier to keep track and for the sake of other developers and debugging situations

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

Give five examples of JavaScript primitives.

A
  1. string
  2. number
  3. boolean
  4. null
  5. undefined.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly