Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

zostan mistrzem

Total questions: 10

Worksheet time: 4mins

Name
Class
Date
1.

What is the output of the following expression?

function multNmbrs(a, b) {

var c = a*b;

}

multNmbrs(2, 6);

a)

12

b)

24

c)

Nothing

2.

What is the correct syntax for referring to an external script called "script.js"?

a)

<script name="script.js">

b)

<script href="script.js">

c)

<script src="script.js">

3.

Choose the names that are acceptable for JavaScript variables.

a)

total%sum

b)

_module

c)

1tv

d)

firstNumber

4.

What's the result of the expression var1&&var2, if var1=true and var2=false?

a)

true

b)

false

c)

undefined

5.

Poniższy kod spowoduje jaką wartość?

test funkcji (number)

{

while (number <5) {

liczba ++;

}

return number;

}

alert (test (2));

a)

2

b)

5

c)

1

d)

3

6.

Jakie ostrzeżenie pojawi się na ekranie?

test function (a, b) {

if (a> b) {

return a * b;

} else {

return b / a;

}

}

alert (test (5, 15));

a)

7

b)

5

c)

1

d)

3

7.

Właściwości obiektu są podobne do zmiennych; metody są podobne do:

a)

warunkowe

b)

Funkcje

c)

operatorów

d)

nieruchomości

8.

function Foo(number) {

this.number = number;

this.add = function(array) {

return array.map(function(number) {

return this.number + number;

});

}

}


var a = new Foo(10);

console.log(a.add([1,2,3,4]));

a)

Tak

b)

Nie

c)

Może

d)

Nie wiem

9.

var array = [2,3,4,5];

for (var i in array) {

console.log(i);

}

a)

0

1

2

3

b)

0

1

2

c)

3210

d)

3

2

1

0

10.

jakich znakow mozna uzyc do uruchomienia zmiennej?

a)

Znak podkreślenia (_)

b)

Listy

c)

Liczby

d)

Operatory matematyczne