WorksheetsReact - Quiz
Total questions: 15
Worksheet time: 7mins
useEffect and useState are called
React Objects
React Arrays
React Hooks
None of the above
const [count, setCount] = useState()
What is the value of count?
0
undefined
null
Syntax error
How many arguments does useEffect has?
1
2
3
No arguments
The second argument of the useEffect is called
Dependency Array
Default Array
Dependency Object
There is no second argument
const [count, setCount] = useState()
What will be the value of count?
undefined
0
null
Syntax error
<></> will be rendered on DOM
True
False
Both True and False
May be
Which array method is used to render lists in react?
forEach()
loop()
map()
list()
useEffect(() => {console.log('10')}, [])
How many times will 10 be printed on the console?
1 time
Only when state changes
10 times
0 times
const { a, b } = { name: "John", age: 40 }
console.log(a)
John
40
undefined
Syntax Error
const { height = 6.5 } = { name: "John", age: 40 }
console.log(height)
undefined
6.5
null
Syntax error
const { a: c, b } = { a: 10, b: 20 }
console.log(a)
ReferenceError: a is not defined
10
undefined
Syntax Error
const { a: c = 1, b } = { a: 10, b: 20, c: 30 }
console.log(c)
1
10
30
Syntax Error
const [a, ...rest, b] = [10,20,30,40,50]
console.log(rest)
20,30,40
[20,30,40]
Syntax Error
undefined
const [a, b, ...rest] = [10,20,30,40,50]
console.log(rest)
[30,40,50]
30,40,50
Syntax Error
undefined
const { ...rest, a, b } = { a: 10, b: 20, c: 30, d: 40 }
console.log(rest)
{a: 10, b: 20}
{c: 30, d: 40}
Syntax Error
{c: 10, d: 20}
