Font size
WorksheetsJavaScript
Total questions: 10
Worksheet time: 6mins
How to get access to number 8 in the following array?
const arr = [[1, 2, 3], [[5, 6, 7, 8], 9]]
arr[[[1,0,3]]]
arr[1][0][3]
arr[1,0,3]
arr[1[0[3]]
What would be the result of this?
const a = 20;
a = 10;
console.log(a)
10
20
it would throw an error
undefined
function getSum(a, b) {
console.log(a + b);
}
const result = getSum(10, 20);
console.log(result);
30
undefined
0
10
What does map function return?
undefined
number
string
array
How to access property name on the object?
const country = {
name: 'Italy',
population: 59550000
};
country,name
country.name
country['name']
country{name}
What would the following comparison produce?
2 == "2"
true
false
undefined
error
Guess the result of this:
{foo: 'bar'} === {foo: 'bar'}
true
false
I haven't learned it yet!
undefined
How to convert number n to string?
n+''
n.toString()
toString(n)
String(n)
How many arguments does function foo accept?
const foo = (array, fn) => fn(array)
0
1
2
What would be the result of the following?
var arr = [1,2,3];
console.log(arr[0]);
1
2
3
undefined
