×

Top 28 Prototype Interview Questions for 2024

1) What is Prototype?

Prototype is a JavaScript framework which is used in dynamic web applications. It is a namespace and a module that is used to manage HTML forms. It is also a JavaScript Library.

2) Who is the developer of Prototype?

Sam Stephenson is the developer of Prototype.

3) What are the features of Prototype?

The features of Prototype are:
  • Extends DOM elements
  • Powerful Ajax features
  • Does not provide widgets
  • Advanced support for event management
  • It is not a complete application development framework
  • Built-in support for class-style OOP including inheritance

4) What are the types of String Methods are available in Prototype?

Prototype String Methods:
blank() camelize() inspect() strip() toJSON()
capitalize() dasherize() interpolate() stripScripts() succ()
empty() endsWith() isJSON() stripTags() toQueryParams()
escapeHTML() extractScripts() startsWith() sub() truncate()
evalJSON() gsub() parseQuery() toArray() unescapeHTML()
evalScripts() include() scan() times() underscore()

5) What is underscore() method in Prototype String Method?

underscore() method: This method is used to converts a String into a series of words separated by an underscore.

6) What is inspect() method in Prototype String Method?

inspect() method: This method is used to returns a debug-oriented version of the string.

7) What is empty() method in Prototype Element Method?

empty() method is used to check whether the element is empty or not.

8) What is Templates in Prototype?

Templates: It is used for formatting group of similar objects. It is also used to produce formatted output for these objects.

9) What are the steps to create the formatted output in Prototype?

The steps to create the formatted output are:
  • Step1: Create a template
  • Step2: Defining actual values
  • Step3: Mapping Keys and replacing Values

10) What is include() method in Prototype?

include method: This method is used to determine whether the value is included in the range or not. If the value is included, then returns true otherwise returns false.

11) What is $A() method in Prototype?

$A() method: This method is used to converts the single argument it receives into an array object.

12) What is $w() method in Prototype?

The $w() method is used to splits a string into an array. Here, all whitespace are treated as delimiters.

13) What is AJAX in Prototype?

AJAX stands for Asynchronous JavaScript and XML. It is a technique which is used for creating faster, better and more interactive web applications.

14) What is Date.toJSON() in Prototype?

The Date.toJSON() method is used to convert the date into a JSON string.

15) What are the ways to construct a Hash instance in Prototype?

Two ways to construct a Hash instance are:
  • By using new JavaScript keyword
  • By using $H(Prototype Utility function)

16) What is the use of PeriodicalExecuter object?

PeriodicalExecuter object: It is used to execute a function many times after a certain period of time.

17) What is the major advantage of PeriodicalExecuter?

The major advantage of PeriodicalExecuter is: PeriodicalExecuter shields you against multiple parallel executions of the callback function.

18) What is the syntax of $R utility function in Prototype?

The syntax of $R utility function is: $R(start, end[, exclusive = false]); Example: $R(1, 10).inspect();

)19) What are the AJAX methods available in Prototype?

The AJAX methods available in Prototype are:
Ajax Options

Ajax.PeriodicalUpdater()

Ajax.Request()

Ajax.Responders()

Ajax.Response()

Ajax.Updater()

20) Name some callbacks that are not implemented by all browsers?

Callbacks that are not implemented by all browsers are:
  • onLoaded
  • onLoading
  • onInteractive
  • onUninitialized

21) What are the methods provided by JSON for Encoding in Prototype?

The methods provided by JSON for Encoding are:
  • Number.toJSON()
  • String.toJSON()
  • Array.toJSON()
  • Hash.toJSON()
  • Date.toJSON()
  • Object.toJSON()

22) What are the features of JSON (JavaScript Object Notation)?

The features of JSON are:
  • JSON is a lightweight data-interchange format
  • Easy to read and write for humans
  • Easy to parse and generate for machines
  • Based on JavaScript Programming Language
  • Completely language independent

23) What is the use of $H method in Prototype?

$H method: This method is used to convert object into enumerable Hash object. Syntax:$H([obj])

24) What will be the output of the following code snippet?

var heyObject = {};  

['foo', 'Tuto', 'rial'].each(function(name, index) {  

this[name] = index;  

}, heyObject);   

heyObject;
Output: { foo: 0, Tuto: 1, rial: 2}

25) What is the syntax of pluck() method in Prototype?

The syntax of pluck() method is: Iterator.pluck(propertyName);

26) What is the use of isHash() method in Prototype?

isHash() method: Returns true if object is an instance of the Hash class, Otherwise returns false.

27) What are the form methods available in Prototype?

The form methods available in Prototype are:
disable()

enable()

findFirstElement()

focusFirstElement()

getElements()

getInputs()

request()

reset()

serialize()

serializeElements()

28) What is the use of isJSON() method in Prototype?

isJSON() method: It is used to check the string is valid JSON with the help of regular expressions.

Related Topics

Top 14 Elixir Interview Questions for 2024

1) What is Elixir? Elixir is a dynamic, functional language. It is designed to build scalable and maintainable applications. 2) Who developed Elixir? Ericsson developed elixir in 1986. 3) What is the stable version of...

2 minutes read.

Top 30 Web2py Framework Interview Questions for 2024

1) What is Web2py Framework? Web2py is an open source web application framework. It is written in the Python programming language. It allows web developers to design and develop dynamic web...

7 minutes read.

Top 31 Dart Programming Interview Questions for 2024

1) What is Dart? Dart is an application programming language. It is used to build web, server and mobile applications. 2) Who is the developer of Dart? Google is the developer of Dart. 3)...

6 minutes read.

Top 15 Java BeanUtils Interview Questions for 2024

1) What is Java BeanUtils? Java BeanUtils is a design pattern component of the Apache Commons. It facilitates architecture for Java language which is derived from JavaAPI. It helps to set...

3 minutes read.

Top 14 Materialize CSS Framework Interview Questions for 2024

1) What is Materialize? Materialize is a CSS framework that contains library file. It is created with CSS, JavaScript and HTML. It helps to create attractive, reliable and functional web pages...

7 minutes read.

Top 24 Clojure Interview Questions for 2024

1) What is Clojure? Clojure is a dynamic, general-purpose programming language. It is simple, coherent and powerful tool. It is based on Lisp Programming language. 2) Which platform is used to run...

4 minutes read.

Top 15 JavaFX Interview Questions for 2024

1) What is JavaFX? JavaFX is a software platform for creating desktop applications or internet application. It uses java library. It can run various devices such as Desktop Computer, Mobile, TVs...

3 minutes read.

Top 15 Java Collections Interview Questions for 2024

1) What is Collections in Java? It is a framework which is used to store and manipulate the group of objects. 2) What are the commonly used methods of Collection interface in...

2 minutes read.

Top 30 Sencha Touch Interview Questions for 2024

1) What is Sencha Touch? Sencha Touch is an UI (User Interface) JavaScript library. It is written in JavaScript. It is used to build mobile interface quickly and easily. It works...

6 minutes read.

Top 15 CSS Buttons Interview Questions for 2024

1) What is CSS buttons? CSS buttons is used to create awesome button. It provides huge collection of CSS library files. 2) What are the CSS libraries to create buttons? There are following...

5 minutes read.

Top 16 Groovy interview Questions for 2024

1) What is Groovy? Groovy is an object oriented programming language. It is based on java platform. It can also be used as scripting language. 2) Who designed the Groovy? James Strachan designed...

2 minutes read.

Top 30 Go Programming Language Interview Questions for 2024

1) What is Go Programming language? Go programming language is an open source programming language. It is developed at Google in 2007. It is designed for system programming language. 2) Who designed...

4 minutes read.

Top 15 Pure CSS Interview Questions for 2024

1) What is Pure CSS? Pure is a CSS (Cascading Style Sheet) framework. It is a collection of small set of responsive CSS modules. We can integrate it to any web...

5 minutes read.

Top 50 ReactJS Interview Questions for 2024

Top 50 Frequently asked ReactJS Interview Questions Q-1. What is React? Ans-1 React is a front-end JavaScript library which is developed by Facebook in 2011. It follows the component-based approach and allows us to...

15 minutes read.

Top 20 C Programming | Coding Interview Questions for 2024

Most Frequently asked C programming | Coding Interview Questions and answer for Fresher C is a powerful high-level programming language.  It is a fast, portable and available for all platforms. C...

15 minutes read.

Top 25 DB2 Interview question for 2024

1) Give breif detail about DB2? DB2 is a Relational Database Management System developed by IBM. It supports Object Oriented features and non-relational structures with XML. 2) Enlist the types of datatypes...

3 minutes read.

Top 30 Less Interview Questions for 2024

1) What is Less? Less is a dynamic style sheet language that can be compiled in to CSS (Cascading style Sheet). It runs on client side and server side. It is...

4 minutes read.

Top 15 MATLAB Interview Questions for 2024

1) What is MATLAB? MATLAB (matrix laboratory) is fourth-generation programming language. It allows matrix manipulations, implementations of algorithm and many more. 2) Who developed MATLAB? MATLAB is developed by MathWorks. 3) In which language...

2 minutes read.

Top 15 XHTML Interview Questions for 202

1) What is XHTML? XHTML (Extensible Hyper Text Markup Language) it is similar to the HTML but has some strict rule than HTML. It is said to be HTML defined as...

3 minutes read.

Top 15 Apache Tapestry Interview Questions for 2024

1) What is Apache Tapestry? It is an open source web framework written in Java and can work under any application server. It is easily integrate with back ends like Hibernate...

2 minutes read.