JS_TESTS-erekle
JS_TESTS-erekle
a. false -
b. true
c. null
d. undefined
3) let age;
what will be the output of: console.log(age);
a. null
b. 0
c. undefined
d. age is not defined
e. false
if(0) {
console.log("Alex")
} else if(1) {
console.log("Saba")
} else if(5>3) {
console.log("Joni")
} else {
console.log("Levani")
}
a. "Alex"
b. "Saba"
c. "Joni"
d. “Levani”
9) let a = 10 % 7;
switch (a) {
case 2:
console.log('Joni');
case 3:
console.log('Alex');
case 7:
console.log('Levani');
default:
console.log('Saba');
}
what will be the output?
a. 'Joni'
b. 'Alex' 'Levani' 'Saba'
c. 'Joni' 'Alex' 'Levani'
d. 'Saba'
e. 'Alex'
16) const a = 5
const sumFunc = (b) => {
const sum = a
return a + b
}
console.log(sumFunc(10))
what will be the output of this console.log?
a. 10
b. 15
c. undefined
d. null
e. 5
f. 30
17) const a = 5
const sumFunc = (b) => {
const sum = a + b
}
console.log(sumFunc(10))
what will be the output of this console.log?
a. 10
b. 15
c. undefined
d. null
e. 5
f. 30
18) const a = 5
const sumFunc = (b) => {
const a = 20
const sum = a + b
return sum
}
console.log(sumFunc(10))
what will be the output of this console.log?
a. 10
b. 15
c. undefined
d. null
e. 5
f. 30
25) Which HTTP method is commonly used to send data from the front-end
(client) to the server?
a. "GET"
b. "DELETE"
c. "SEND"
d. "POST"
e. "PUT"
admin = 'Pete';
console.log(user);
what will be the output of this console.log?
a. "John"
b. "Pete"
c. null
d. "John Pete"
e. undefined
28) setTimeout(function() {
console.log("This message is displayed after 3 seconds.");
}, 3);
how much time it needs to show the console.log output?
a. 3000 seconds
b. equal or more than 0.003 seconds
c. equal or more than 3 seconds
33) how can we remove less than 10 elements from: const array = [10, 20, 1,
4, 5, 34];
a. array.map(item => item > 10)
b. array.filter(item => item = 10)
c. array.filter(item => item > 10)
d. array.map(item => item < 10)
34) let name1 = null;
let name2 = “Messi“
let name3;
let name4 = “Ronaldinho“
console.log( name1 || name2 || name3 );
what will be the output of this console.log function?
a. “name1“
b. undefined
c. “Ronaldinho“
d. “Messi“
e. null
a. [[1,2,3], [4,4,5,6,7]]
b. [1,2,3,4, [4,5,6,7]]
c. [[1,2,3, 4,4,5,6,7]]
d. [1,2,3,4,4,5,6,7]
e. [4, 4, 5, 6, 7]
f. [[4, 4, 5, 6, 7]]
37) console.log(name)
var name = “Alex“
what will be the output of this console.log?
a. null
b. undefined
c. “Alex“
d. Error
38) how can we access html DOM elements into Javascript file?
a. with class attribute
b. we can not access html DOM elements into Javascript file
c. with className attribute
d. with ID attribute