Lesson 6: Working with Numbers Flashcards
What are some Data Types?
- String
- Boolean true/false
- Null
- Undefined
What are..
- Ox
- Ob
- Oo
Ox = Hexadecimal Ob = Binary Oo = Octal
Show an example of Ox:
let x = oxff;
Show an example of Ob:
let x = ob111;
Show an example of Oo:
let x = oo777;
What does toFixed do?
Returns a string with specified decimal places.
What does the toString method do?
Converts a number into a string with the numerical base of the number.
What are Number Objects used for?
To check and covert a numerical value.
Number.isNaN(o/o):
Returns true.
Number.isNaN(“abc”);
Returns false.
What are the two values of Boolean type?
True or false.
What does Null represent?
A valid but nonexistent value.
What does Undefined indicate?
A variable has been declared but not assigned a value.
What is an integer?
A whole number.
What are Floating-Point numbers?
A number that contains a fractional part.
What does the Number.isInteger() method do?
Determines whether a value or expression passed to it evaluates to an integer.
What is the Number() function used for?
Getting numerical values from other data types.
Number(true);
Returns 1.
Number(false);
Returns 0.
Number(‘horse’);
Returns NaN.
Number(“666”);
Returns 666.
What does the Negation Operator (!) mean?
Placed before a Boolean variable, means “the opposite value”.