Quiz
Closures
Questions in this quiz (5)
1What are closures?
- AClosures are functions
- BClosures are easier said than done
- CClosure is an abstract and elusive concept
- DClosure is what you get on new year's eve
- EClosure is putting things in a box and packing it up
2the output of the code in case of closures:
var me = 'Bruce Wayne'
function greetMe() {
console.log('Hello, ' + me + '!')}
greetMe()- AHello, me!
- BHello, Bruce Wayne!
- CHello, Batman!
- DHello, Dark Knight!
- EFatal Error
3The output of the code in case of non-closures:
var me = 'Bruce Wayne'
function greetMe() {
console.log('Hello, ' + me + '!')}
greetMe()- AHello, Batman!
- BHello, Jarvis!
- CHello, undefined!
- DHello, Joker!
- Efunction greetMe() {
console.log('Hello, ' + me + '!')}
}
4The output of the code in JS:
var me = 'Bruce Wayne'
function greetMe() {
console.log('Hello, ' + me + '!')}
me = 'Batman'
greetMe()- Aundefined
- BHello, Batman!
- CHello, undefined!
- DHello, NULL!
- EHello, Bruce Wayne!
5A language without the support of closures would need one of these:
- Adestructuring
- Bdata object or a request object
- Cpolite words
- Da data structure like arguments
- Elinked lists
Information
- Description
- Quiz on Closures, created by Rimika Chaudhury on 18/06/2018.
- Author
- Rimika Chaudhury
- Language
- English
- Views
- 0
- Rating
- No ratings yet Rate this quiz