MCQs > IT & Programming > Prototype Programming MCQs > Basic Prototype Programming MCQs

Basic Prototype Programming MCQ

1. All arthropods _____.

Answer

Correct Answer: Undergo complete metamorphose

Note: This Question is unanswered, help us to find answer for this one

2. Design prototyping is also known as ____ prototyping.

Answer

Correct Answer: Throwaway

Note: This Question is unanswered, help us to find answer for this one

3. A prototype includes ________ in a category. an exemplar includes ________ in the category.

Answer

Correct Answer: All examples of concepts; only stereotypical concepts

Note: This Question is unanswered, help us to find answer for this one

4. A function prototype is ____.

Answer

Correct Answer: A declaration, but not a definition

Note: This Question is unanswered, help us to find answer for this one

5. What does identify method of element do?

Answer

Correct Answer: It returns element's ID. If element does not have an ID, one is generated, assigned to element, and returned..

Note: This Question is unanswered, help us to find answer for this one

6. Which of the following ways can you use to check whether prototype is loaded or not?

Answer

Correct Answer: typeof(Prototype) === "object"

Note: This Question is unanswered, help us to find answer for this one

7. Which of the following methods can you use to make an element droppable?

Answer

Correct Answer: Droppables.add($('id1')); 

Note: This Question is unanswered, help us to find answer for this one

8. What will be returned if Event.findElement("click", "div"); cannot find any elements that match the specified tag?

Answer

Correct Answer: document

Note: This Question is unanswered, help us to find answer for this one

9. The number of arguments of Try.these() are ___

Answer

Correct Answer: infinite 

Note: This Question is unanswered, help us to find answer for this one

10. Function.bind(object); will replace ___ variable in function by "object".

Answer

Correct Answer: this

Note: This Question is unanswered, help us to find answer for this one

11. What does match method of element do?

Answer

Correct Answer: It checks whether this element matches the given css selector.

Note: This Question is unanswered, help us to find answer for this one

12. Which of the following functions converts html special characters to their entity equivalents?

Answer

Correct Answer: escapeHTML

Note: This Question is unanswered, help us to find answer for this one

13. Which of the following code snippets moves id1 element?

Answer

Correct Answer: new Effect.Move(

Note: This Question is unanswered, help us to find answer for this one

14. Which of the following methods allows you to set many style attributes in one call?

Answer

Correct Answer: setStyle

Note: This Question is unanswered, help us to find answer for this one

15. Which of the following code snippets is the proper way to define a class that inherits another class?

Answer

Correct Answer: var Dog = Class.create(Animal, {});

Note: This Question is unanswered, help us to find answer for this one

16. Consider the following code snippet:
var template = new Template("This is #{framework} version #{version}");
var a = {framework: "Prototype", version: "1.6.1"}
var b = template.evaluate(a);
What is the result of b?

Answer

Correct Answer: This is Prototype version 1.6.1

Note: This Question is unanswered, help us to find answer for this one

17. What does $F(element).getValue() return?

Answer

Correct Answer: It returns the current value of a form control.

Note: This Question is unanswered, help us to find answer for this one

18. Which of the following statements is valid?

Answer

Correct Answer: Object.isUndefined(a);

Note: This Question is unanswered, help us to find answer for this one

19. How can you stop an event from propagating?

Answer

Correct Answer: Event.stop

Note: This Question is unanswered, help us to find answer for this one

20. ___ extends event with all of the methods contained in Event.Methods.

Answer

Correct Answer: Event.extend

Note: This Question is unanswered, help us to find answer for this one

21. The callback function in options of Ajax.Autocomplete() is called ___ the request is actually made

Answer

Correct Answer: before

Note: This Question is unanswered, help us to find answer for this one

22.

Consider the following code snippet:
new Effect.Scale(agr1, arg2);
What is arg2 parameter?

Answer

Correct Answer: Percentage to scale

Note: This Question is unanswered, help us to find answer for this one

23. If you want to make an Ajax request using xml instead of the regular URL-encoded format, which option parameter do you have to change?

Answer

Correct Answer: contentType

Note: This Question is unanswered, help us to find answer for this one

24. What is the result of the following function?
function a() {
   var x = 10;
 return x.toPaddedString(4);
}

Answer

Correct Answer: 0010
10.00

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

25. Which of the following functions returns the element that occurred?

Answer

Correct Answer: Event.element

Note: This Question is unanswered, help us to find answer for this one

26. Which of the following objects allows you to monitor Ajax activities?

Answer

Correct Answer: Ajax.Responders

Note: This Question is unanswered, help us to find answer for this one

27. When is the Ddom:loaded event fired?

Answer

Correct Answer: After the DOM tree is loaded, before window's load event.

Note: This Question is unanswered, help us to find answer for this one

28. What is the result of the following code snippet?
[1, 2, 3, 4, 5].detect(function(n) {return n % 3});

Answer

Correct Answer: 1

Note: This Question is unanswered, help us to find answer for this one

29. Which of the following effects are core effects?

Answer

Correct Answer: Effect.Opacity

Note: This Question is unanswered, help us to find answer for this one

30. Which of the given options is the result of the following code snippet?
new Builder.node("div", {className: "error"}, "Error");

Answer

Correct Answer: Create a div tag that has "error" as class name and contains "Error" text.

Note: This Question is unanswered, help us to find answer for this one

31. If you create a draggable object, but do not create any droppable objects, then the draggable object cannot be moved by drag and drop actions.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

32. Consider the following code snippet:
Element.addMethods({
 : show: function(element) {
 : alert("This is prototype.");
  }
});

What does this code snippet do?

Answer

Correct Answer: It adds show method to all elements.

Note: This Question is unanswered, help us to find answer for this one

33. __________ allows more than one effects to occur at the same time.

Answer

Correct Answer: Effect.Parallel

Note: This Question is unanswered, help us to find answer for this one

34. What is the valid range of $R(1, 10, true);?

Answer

Correct Answer: 1 to 9

Note: This Question is unanswered, help us to find answer for this one

35. Consider the following code snippet:
Sortable.create("id1");
Assume that nodes which id: id11, id12 are children of id1 and nodes which id: id111, id112 are children of id11. Which of the following elements can be sortable?

Answer

Correct Answer: id11 and id12

Note: This Question is unanswered, help us to find answer for this one

36. What is the difference between the names of native browser events and prototype custom events?

Answer

Correct Answer: Custom events have a colon (:) in their name.

Note: This Question is unanswered, help us to find answer for this one

37. Which of the following methods allows you to add a new instance of method to a class after that class has been defined?

Answer

Correct Answer: initialize

Note: This Question is unanswered, help us to find answer for this one

38. What is the result of the following code snippet?
[1, 2, 3, 4, 5].map( function(num) { return num * num; } );

Answer

Correct Answer: [1, 4, 9, 16, 25]

Note: This Question is unanswered, help us to find answer for this one

39. Which of the following is/are a valid callback of core effects?

Answer

Correct Answer: beforeStart

Note: This Question is unanswered, help us to find answer for this one

40. Which of the following options is/are valid element(s) of the function-Form.Element.present(element)

Answer

Correct Answer: input

Note: This Question is unanswered, help us to find answer for this one

41. Consider the following code snippet:
new Effect.Scale("id1", arg2);
Which attribute(s) is id1 element scaled to?

Answer

Correct Answer: width

Note: This Question is unanswered, help us to find answer for this one

42. Which of the following statements displays prototype version of Prototype?

Answer

Correct Answer: Prototype.Version

Note: This Question is unanswered, help us to find answer for this one

43. The time to complete an effect generally depends on the speed of the computer.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

44. Consider the following code snippet: var s = "; (5).times(function(n) {    s += n; }); alert(s); What does the alert box display?

Answer

Correct Answer: 01234

Note: This Question is unanswered, help us to find answer for this one

45. Which of the following element methods finds siblings of that element?

Answer

Correct Answer: adjacent

Note: This Question is unanswered, help us to find answer for this one

46. If the server response time is slow, you may consider increasing the ___ option parameter to reduce the response time.

Answer

Correct Answer: frequency

Note: This Question is unanswered, help us to find answer for this one

47. Which of the following properties holds the number of active requests?

Answer

Correct Answer: Ajax.activeRequestCount

Note: This Question is unanswered, help us to find answer for this one

48. Which of the following parameters is/are valid parameter(s) of Effect.Highlight() method?

Answer

Correct Answer: restorecolor

Note: This Question is unanswered, help us to find answer for this one

49. Which of the following methods allows you to add class to a class after that class is defined?

Answer

Correct Answer: Class.addMethods

Note: This Question is unanswered, help us to find answer for this one

50. What does cleanWhiteSpace method of element do?

Answer

Correct Answer: It removes all of element's child text nodes that contain only whitespace.

Note: This Question is unanswered, help us to find answer for this one

51. What is the result of the following code snippet?
[1, null, 2, false, 3].partition();

Answer

Correct Answer: [[1, 2, 3], [null, false]]

Note: This Question is unanswered, help us to find answer for this one

52. PeriodicalUpdater updates an element ___

Answer

Correct Answer: at the given frequency.

Note: This Question is unanswered, help us to find answer for this one

53. Which of the following functions updates an existing hash?

Answer

Correct Answer: update

Note: This Question is unanswered, help us to find answer for this one

54. Consider the following code snippet:
new Ajax.InPlaceEditor("id1", "save.jsp");
What is the request parameter name of id1 element on server When its value changes?

Answer

Correct Answer: value

Note: This Question is unanswered, help us to find answer for this one

55. What does the statement $("item1", "item2", "item3"); return?

Answer

Correct Answer: A collection of elements with item1, item2, item3 ids.

Note: This Question is unanswered, help us to find answer for this one

56. You have a local autocomplete like the following:
new Autocompleter.Local(arg1, arg2, arg3, arg4);
Assume that you want to create a local autocomplete text field. You want to display all possible values on div1 div element and show this div to the user. Which of the following arguments is the value of div1 div?

Answer

Correct Answer: arg2

Note: This Question is unanswered, help us to find answer for this one

57. Consider the following code snippet:

var a = {framework: "Prototype", version: "1.6.1"};
var b = a.toObject();
alert(b.version);

What does the alert box display?

Answer

Correct Answer: This code snippet causes an error. 

Note: This Question is unanswered, help us to find answer for this one

58. Which of the following functions is used to call the initialize method of the parent class?

Answer

Correct Answer: $super

Note: This Question is unanswered, help us to find answer for this one

59. What is the result of the following code snippet?
el.insert("«span»Prototype«/span»");

Answer

Correct Answer: «span«Prototype«/span« will be the last child of el.

Note: This Question is unanswered, help us to find answer for this one

60. Which of the following tags can make element draggable?

Answer

Correct Answer: span

Note: This Question is unanswered, help us to find answer for this one