Lesson 6: Working with Numbers Flashcards

1
Q

What are some Data Types?

A
  • String
  • Boolean true/false
  • Null
  • Undefined
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are..

  • Ox
  • Ob
  • Oo
A
Ox = Hexadecimal
Ob = Binary
Oo = Octal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Show an example of Ox:

A

let x = oxff;

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

Show an example of Ob:

A

let x = ob111;

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

Show an example of Oo:

A

let x = oo777;

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

What does toFixed do?

A

Returns a string with specified decimal places.

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

What does the toString method do?

A

Converts a number into a string with the numerical base of the number.

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

What are Number Objects used for?

A

To check and covert a numerical value.

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

Number.isNaN(o/o):

A

Returns true.

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

Number.isNaN(“abc”);

A

Returns false.

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

What are the two values of Boolean type?

A

True or false.

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

What does Null represent?

A

A valid but nonexistent value.

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

What does Undefined indicate?

A

A variable has been declared but not assigned a value.

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

What is an integer?

A

A whole number.

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

What are Floating-Point numbers?

A

A number that contains a fractional part.

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

What does the Number.isInteger() method do?

A

Determines whether a value or expression passed to it evaluates to an integer.

17
Q

What is the Number() function used for?

A

Getting numerical values from other data types.

18
Q

Number(true);

A

Returns 1.

19
Q

Number(false);

A

Returns 0.

20
Q

Number(‘horse’);

A

Returns NaN.

21
Q

Number(“666”);

A

Returns 666.

22
Q

What does the Negation Operator (!) mean?

A

Placed before a Boolean variable, means “the opposite value”.