Chapter 2 - Data And Decisions Flashcards

(59 cards)

0
Q

What is a number?

A

A number, including floating points number

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

What is a string?

A

A series of characters

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

What is a boolean data?

A

True or false

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

What are the 3 primitives data types?

A

String
Number
Boolean

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

What is Null?

A

Even though a variable had been created, its current value is Null or nothing

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

What is Undefined?

A

Indicates that something has not been defined and given a value

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

How does string data must be encloses?

A

Between ‘ ‘ or “ “

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

How to write a string like Paul’s character?

A

Document.write(“Paul’s character”)

Use the “ because there is a ‘ in the string

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

What are escape séquences?

A

To use character that can’t be typed using a keyboard

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

\b

A

Backspace

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

\f

A

Form Feed

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

\n

A

Newline

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

\r

A

Carriage return

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

\t

A

Tab

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

'

A

Single quote

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

"

A

Double quote

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

\

A

Backslash

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

\xNN

A

nN is a number from hexadecimal

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

\uDDDD

A

DDDD is hexadecimal from Unicode

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

+

A

Adds

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

-

A

Substracts

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

*

A

Multiply

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

/

A

Divides

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

%

24
--
Decrease By 1
25
++
Increase By 1
26
+ with non number
Concatenate
27
How to name variable?
Camel notation anusToMouth
28
Prompt()
Ask the user a value and returns it to the code | Var eurosToConvert = prompt("How many...", "");
29
Typeof()
Know the type of data
30
Number()
Tries to convert to number
31
Parsefloat()
Tries to convert to a floating number. Or NaN
32
ParseInt()
To an integer
33
3 objects from javascript
String Date Math
34
How to create a string object?
Implicit and explicit
35
Object.length
Give the length of a string object
36
Explicit string?
Var MyStringObject = new String( "abc" );
37
UserEmail.indexOf( "@" ); ?
Return -1 if No @ found
38
myOldString.substring( 2, 5);
Return character 3 to 5 because it starts at 0 and doesn't include the last one (5)
39
How can I create Date objects?
``` Only explicitely Var todaysdate = new Date(); ```
40
How to specify the month of a date?
3 First letter
41
Date object parameter
Var someDate = new Date( aYear, aMonth, aDate, anHour, aMinute, aSecond, aMillisecond)
42
Where does date month start count ing?
0
43
Date objects method?
getXXXX and setXXXX
44
What does setDate(32); so?
Go to the next month (useful to add days)
45
How to create a math object?
Only implicitely
46
Does the math object store data?
No
47
How to call a math object method?
Math.methodOfMathObject( aNumber )
48
Math.parseInt()
Remove the decimals
49
Math.round()
Round as usual
50
Math.ceil()
Always round up
51
Math.floor()
Rounds down
52
Math.random()
Random between 0 and 1
53
Use of an Array?
Store data
54
How to initialize an Array?
Var preInitArray = new Array("First Item", "Second Item", "Third Item");
55
How to Set an Array to hold 3 items?
Var PreDeterminedSizeArray = new Array( 3 );
56
How to create an Empty Array?
Var anArray = new Array();
57
How to add new items to an Array?
``` anArray[0] = "anItem"; anArray[1] = "anotherItem"; ```
58
Shortcut notation to add to an Array?
Var myArray = [ 1, 2, 3];