JavaScript revision

HideShow resource information
Why do we need Computer Programming?
Computer Hardware needs Software to work, Programming is the way that Software is produced.
1 of 29
What is Syntax in computer programming?
The rules and grammar of computer programming.
2 of 29
What does the .length key word give us in JavaScript?
The number of characters in a word or sentence.
3 of 29
Which Keyword defines a variable
var
4 of 29
How would you use it to define a variable called Name?
var name
5 of 29
What characters need to be typed at the front of a line of JavaScript, to make it into a comment?
//
6 of 29
What does the computer do with a comment in a computer program?
It ignores it, it is there only for humans to read.
7 of 29
What punctuation mark would be the correct one to put at the end of this line of code to ensure that it has the correct syntax? console.log("Good morning!")
a semicolon ;
8 of 29
What will this line of code do? prompt("How old are you?")
It creates a pop up box that will ask the user to answer the question How old are you?
9 of 29
What are the keywords that will make the computer print something out?
console.log(); or print();
10 of 29
What is Binary?
It is the machine language that a computer uses.
11 of 29
What are the only two characters in Binary?
0 and 1.
12 of 29
What will be the result of this code? "Tomato".length * 3 ===
Tomato has 6 letters so it will calculate 6 * 3 = 18
13 of 29
Why is a loop in a computer program useful?
It makes the computer repeat a task more than once.
14 of 29
What syntax can be used to increase a number in a loop?
++ or +=
15 of 29
What syntax can be used tp decrease in a loop?
-- or -=
16 of 29
What will the following code do? for var(i=1; i
It will count from 1 to 20 going up in fours, e.g. 4,8,12,16,20.
17 of 29
Look at this code if(result < 60) {console.log("Fail");} else {console.log("Pass");} if your result was 75?
It would print out the word Pass.
18 of 29
Why is an array useful?
It allows us to store more than one variable in a program.
19 of 29
What is indexing in an array?
It tells the array where to start.
20 of 29
What will this line of JavaScript assign to the variable dog? var dog =["Poodle", "Beagle", "Labrador"]
The names Poodle, Beagle and Labrador.
21 of 29
What will this line of code show on the screen? "Highams".substring(0,3)
Hig
22 of 29
What JavaScript will calculate the volume of cube?
var cube = function(width, length, height) volume = width * length * height console.log("The area of the cube is " + volume + "Square Meters");
23 of 29
How would you call a function volume, for a cube with height 20, width 20 and depth 20?
cube (20,20,20);
24 of 29
What are variables?
Something that can be changed or measured, e.g. length.
25 of 29
Name another computer programming language other than JavaScript.
Python, html.
26 of 29
What does this operator mean? >
Greater than
27 of 29
What does this operator mean?
Less than.
28 of 29
What does this operator mean? ===
equal to.
29 of 29

Other cards in this set

Card 2

Front

What is Syntax in computer programming?

Back

The rules and grammar of computer programming.

Card 3

Front

What does the .length key word give us in JavaScript?

Back

Preview of the front of card 3

Card 4

Front

Which Keyword defines a variable

Back

Preview of the front of card 4

Card 5

Front

How would you use it to define a variable called Name?

Back

Preview of the front of card 5
View more cards

Comments

No comments have yet been made

Similar Computing resources:

See all Computing resources »See all Coding resources »