Worksheetszostan mistrzem
Total questions: 10
Worksheet time: 4mins
What is the output of the following expression?
function multNmbrs(a, b) {
var c = a*b;
}
multNmbrs(2, 6);
12
24
Nothing
What is the correct syntax for referring to an external script called "script.js"?
<script name="script.js">
<script href="script.js">
<script src="script.js">
Choose the names that are acceptable for JavaScript variables.
total%sum
_module
1tv
firstNumber
What's the result of the expression var1&&var2, if var1=true and var2=false?
true
false
undefined
Poniższy kod spowoduje jaką wartość?
test funkcji (number)
{
while (number <5) {
liczba ++;
}
return number;
}
alert (test (2));
2
5
1
3
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));
7
5
1
3
Właściwości obiektu są podobne do zmiennych; metody są podobne do:
warunkowe
Funkcje
operatorów
nieruchomości
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]));
Tak
Nie
Może
Nie wiem
var array = [2,3,4,5];
for (var i in array) {
console.log(i);
}
0
1
2
3
0
1
2
3210
3
2
1
0
jakich znakow mozna uzyc do uruchomienia zmiennej?
Znak podkreślenia (_)
Listy
Liczby
Operatory matematyczne
