Test
This
Crea una cuenta gratis para terminar este test
Guarda tu progreso y consulta tu resultado final.
¿Ya tienes cuenta? Inicia sesión
Preguntas del test (6)
1What ways can "this" take a value?
- AIn normal function calls
- BWithin methods on objects
- CWithin an object that has been constructed
- DA function invoked with .call, .apply, or bind
2What does "this" refer to below?
function helloWorld() {
console.log("Hello world!");
console.log(this);
};
helloWorld();- AThe window object in the global context of a normal function.
- BThe string "Hello world"
- Cconsole.log
- DThe function name "helloWorld()".
3What type of function is the one shown below?:
var City = function(name, state) [
this.name = name || 'Portland';
this.state = state || 'Oregon';
};- AConstructor Function
- BGlobal Function
- CLocal Function
- DMal Function
4When a constructor function is used to create a new object, what does "this" refer to?
- AThe object that is created.
- BThe constructor function.
- CThe global function.
- DThe local function.
5What does "this" ALWAYS refer to and holds the value of?
- AAn object
- BA variable
- CA function
- DA procedure
6When used in a global function in a browser with strict mode, what does "this" refer to?
- AThe global window object
- BBoth the global window object and its value
- CThe function
- DGlobal variables
Información
- Descripción
- Doctorate JavaScript Test sobre This, creado por doolezah el 10/07/2015.
- Autor
- doolezah
- Idioma
- English
- Visitas
- 6
- Etiquetas
- Valoración
- Aún sin valoraciones Valora este test