Font size
WorksheetsJS array & object
Total questions: 37
Worksheet time: 9hrs 15mins
Given: Five diggers dig 5m of a ditch in 5 hours. How many diggers will it take to dig 100m of a ditch in 100 hours?
5
1
100
10
Which array methods return a new array?
some
map
filter
forEach
none of the above
Which of the array methods will remove and return the first element of the array?
pop
push
shift
unshift
none of the above
Which of the array methods will remove and return the last element of the array?
pop
push
shift
unshift
none of the above
Which of the array methods or properties will return the length of the new/existing array?
pop
push
length
unshift
none of the above
Which array methods pass 4 arguments to the callback function?
reduce
map
reduceRight
forEach
none of the above
What will the 'fill' method return? [1, 2, 3, 4, 5, 6].fill(0, 2, 3)
[0, 2, 3, 0, 2, 3]
[1, 2, 0, 4, 5, 6]
[1, 2, 0, 1, 2, 0]
[4, 5, 5, 1, 2, 3]
If the second argument in the reduce method is not specified, then?
will display an ReferenceError: 'argument' is not defined
will display a SyntaxError: 'x' is a reserved identifier
will display the first element of the array as an initial accumulator
will take 'undefined' as the initial accumulator
return 'undefined' as a function result
Which array methods will return a string as a result?
slice()
toString()
join('')
splice()
concat()
Which array methods will return a boolean as a result?
every()
some()
indexOf()
includes()
copyWithin()
Which method can be used to create a new array?
of()
reverse()
find()
from()
sort()
Which array methods will return the cell value if the condition is met?
of()
includes()
find()
indexOf()
lastIndexOf()
Which array methods will return the position of the cell if the condition is met?
of()
lastIndexOf()
find()
indexOf()
includes()
Which array methods modify the original array?
slice()
splice()
reverse()
some()
pop()
You can check whether an array (consisting of strings) contains a given string using the following method?
findIndex()
lastIndexOf()
includes()
find()
indexOf()
Which array methods return a new array with all the elements that satisfy the callback condition?
findIndex()
every()
filter()
find()
forEach()
What will it return? [1,2,3,4,5,6].slice(2,3)
3
['3']
[2, 3]
[2, 3, 2, 3, 2, 3]
[3]
What will return console.log?
{"name": "John", "visits": true, "isAdmin": true}
{"name": "John", "visits": true, "isAdmin": false}
{"isAdmin": true}
{"name": "John"}
Which methods will return an array?
Object.valueOf()
Object.entries()
Object.keys()
Object.values()
Which methods set property descriptors?
Object.is()
Object.freeze()
Object.defineProperty()
Object.hasOwnProperty()
Object.getOwnPropertyDescriptors()
What descriptors can be defined or modified properties of an object?
configurable
enumerable
value
writable
readable
Number in JS as a default stored in:
64bits
32bits
16bits
8bits
Which of the items will display [object Object], if const obj = {} ?
console.log(obj.valueOf())
console.log(obj.toString())
console.log(obj.toLocaleString())
console.log(obj.isPrototypeOf())
What will the code below output to the console? let result = "ten" × 2; console.log(result == NaN)
true
false
null
undefined
What will the below code output to the console? let arr1=new Array(3); console.log(arr1[0]);
true
"3"
null
undefined
3
What will the code below output to the console?
true
false
null
undefined
NaN
What will the code below output to the console?
1
5
6
20
Uncaught ReferenceError: obj is not defined
What will the code below output to the console?
true
false
undefined
"global"
Uncaught ReferenceError: globalVar is not defined
What will the code below output to the console?
"52"
52
7
5undefined
Uncaught ReferenceError: j is not defined
What will the code below output to the console?
true
false
null
undefined
Uncaught ReferenceError: obj is not defined
What will console.log output?
"257"
14
7
3
Uncaught ReferenceError: x is not defined
What will the code below output to the console?
true
false
null
undefined
Uncaught ReferenceError: test2 is not defined
What will the code below output to the console?
10
10undefind
19
undefindundefind
Uncaught ReferenceError: j is not defined
What will the code below output to the console?
6
undefindundefind
42
24
Uncaught ReferenceError: answer is not defined
What will the code below output to the console?
6 5
5 5
undefined 5
Uncaught TypeError: mers.currentGear is not a function
What will the code below output to the console?
Bruce Wayne Bruce Wayne
Bruce Wayne Clark Kent
Which methods make the object unavailable?
Object.is()
Object.freeze()
Object.defineProperty()
Object.hasOwnProperty()
Object.getOwnPropertyDescriptors()
