Test
Closures
Preguntas del test (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
Información
- Descripción
- Test sobre Closures, creado por Rimika Chaudhury el 18/06/2018.
- Autor
- Rimika Chaudhury
- Idioma
- English
- Visitas
- 0
- Valoración
- Aún sin valoraciones Valora este test