¡GoConqr estrena diseño! Cuéntanos qué te parece.

Test

Javascript - Quiz - Jan 2016

arunram.krish 15 preguntas 4,0 (2 valoraciones)

Hacer el test

Este test tiene tiempo límite, así que se abre en el reproductor de siempre.

Preguntas del test (15)

  1. 1What are the values that evaluate to false when used in a Boolean expression?
    1. AOnly null
    2. BOnly undefined
    3. COnly “”
    4. DOnly NaN
    5. EAll of the above
  2. 2Which of the following statements are TRUE?
    1. AWhen a variable that is not declared is used it returns “undefined”
    2. BWhen a variable that is not declared is used it throws ReferenceError
    3. CA function that is defined below in the later part of the script can be invoked / referred
    4. DA variable that is not assigned any value returns “undefined”
  3. 3What are the primitive types in Javascript?
    1. AInt, float, double, char, Boolean
    2. BInt, float, double, char, String, Boolean
    3. CNumber, String, Boolean
    4. DNumber, char, String, Boolean
  4. 4How do you create an Object with a prototype object assigned to variable “proto”?
    1. Avar myObject = new Object(proto);
    2. Bvar myObject = new Object();
      myObject.prototype = proto;
    3. Cvar myObject = Object.create(proto);
    4. Dvar myObject[“prototype”] = proto;
  5. 5How to create a Javascript array?
    1. AOnly var myArray = new Array();
    2. BOnly var myArray = [];
    3. Cvar myArray[] = new Object();
    4. DBoth a & b
  6. 6How do you invoke parent class’ constructor (by name ParentClass) from a sub class constructor (by name SubClass) to inherit properties defined in ParentClass in the new SubClass object?
    1. Afunction SubClass() { super(); }
    2. Bfunction SubClass() { ParentClass(); }
    3. Cfunction SubClass() { new ParentClass(); }
    4. Dfunction SubClass() { ParentClass.apply(this, arguments); }
    5. EAll of the above
  7. 7How do you use function to create a singleton object?
    1. Avar mySingleton = function() {
      function SingletonClass() {
      }
      return new SingletonClass();
      };
    2. Bb. var mySingleton = (function() {
      function SingletonClass() {
      }
      return new SingletonClass();
      })();
    3. Cvar mySingleton = {};
    4. DIt is not possible to create a singleton object using function
  8. 8What is a Closure?
    1. AA special scope variable assigned to function that holds states / variables that was accessible at the time of defining this inner function
    2. BClosure is a property of function that needs to be explicitly assigned within the body of function
    3. CClosure is a global function along with global variables
    4. DClosure is an inner function along with global variables
  9. 9How do you invoke a callback function within a loop with loop index variable as argument after 500 milliseconds?
    1. Afunction invokeCallback(callback) {
      for(var i=0;i<5;i++) {
      setTimeout(callback(i), 500);
      }
      }
    2. Bfunction invokeCallback(callback) {
      for(var i=0;i<5;i++) {
      setTimeout(function() {callback(i)}, 500);
      }
      }
    3. Cfunction invokeCallback(callback) {
      function invoker(i) {
      return function() { callback(i); }
      }
      for(var i=0;i<5;i++) {
      setTimeout(invoker(), 500);
      }
      }
    4. DNone of the above
  10. 10How do you add a function “removeDuplicates” (already defined with this name) accessible from all Array objects?
    1. AArray.removeDuplicates = removeDuplicates;
    2. BArray.prototype.removeDuplicates = removeDuplicates
    3. Cvar myArray = new Array() {
      this.removeDuplicates = removeDuplicates;
      }
    4. DArray is a predefined type in javascript. It cannot be modified.

Información

Descripción
Javascript Quiz for emids participants
Idioma
English
Visitas
496
Etiquetas
javascriptquizemidscomputer sciencejavascript - jan 2016intermediate
Valoración
4,0 de 5 · 2 valoraciones
Valora este test
Valora este test

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?