JS Programing - Khan akademy basic Flashcards

To memorise the main ideas of each session

1
Q

How many types of variables do you know?

A
  1. One value variable
  2. Arrays []
  3. Objects { }
  4. Function () {}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you debug, what function do you use?

A

Println ()

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

How do you Draw: a line, a rectangle, an ellipse, a circle

A

line (x, y, Hight, With)

rect (x, y, Hight, With)

ellipse (x, y, Hight, With)

ellipse (x, y, Hight, Hight)

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

What function is looping continuously (used for animation)?

A

Draw () { };

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

What loop functions do you know?

A

While ( ) { }

For ( ) { }

Draw ( ) { }

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

How do you call a “For” function and what is it’s structure?

A

It is a Loop Function

For (var i=1; i>10; i++) { };

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

How do you call a while function and what is it’s structure?

A

It is a Loop function.

Var i=1;

while (i<10) {

i++;

};

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

Do you know any conditional statement?

A

The if () { } statement.

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

What is the structure of the if statement. What other if structures are available in Java Script?

A

if (condition is true) { };

If (condition) { }; else { };

if (condition) { }; else if (condition) { }; else { };

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

What function will deliver the x and y coordinates of the mouse’s position?

A

Mouse X

Mouse Y

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

What conditional function is true if the mouse is pressed?

A

MouseIsPressed ();

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

How can you incerease or decrease the value of a variable (i) by 1?

A

i = i + 1; i = i - 1;

i++; i–;

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

What type of data do you know?

A

text

integer

boolean

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

From where did the boolean data type got its name and what values can it have?

A

The name is from George Boolean.

Values: True False

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

How can you incerease the value of a variable (i) by 14

How can you decrease the value of a variable (i) by 14

A

i = i + 14; i = i - 14;

i += 14; i -= 14

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

What operators do you use to check if two values are equal?

What operators do you use to check if two values are NOT equal?

A

i === y;

i !== y;

17
Q

What operators do you use for AND?

A

&&

18
Q

What operator do you use for OR?

A

||

19
Q

How can you round a number up?

A

Ceiling ()

Round () - if the number is equal or higher that 0.5

20
Q

How can you round a number down?

A

Floor ();

Round () - if the number is lower than 0.5

21
Q

How do you make an object without a contour?

A

noStroke ();

22
Q

How do you write a text in JS?

A

text (x, y, hight, with)

23
Q

What is the structure of a function?

A

Without input: () { };

With input: function (data1, data2, …) { };

24
Q
A