×

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 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.

Top 28 Angular 2 Interview Questions for 2024

1) What is Angular 2? It is an open source JavaScript framework which is used to build web applications in JavaScript and HTML. It is also used to overcome obstacles encountered while...

4 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 30 Drupal Interview Questions for 2024

1) What is Drupal? Drupal is an open source CMS (Content Management System) framework. It is written in php and provides rich set of tools to create web sites. 2) What are...

4 minutes read.

Top 31 PHP Interview Questions for 2024

1) What is PHP? PHP is a object-oriented scripting language, open source, interpreted and executed at server side. It is also used to develop web applications. 2) What are the features of PHP? Features...

4 minutes read.

Top 40 IoT Interview Questions and Answers in 2024

Q.1 What is IoT? IoT stands for the Internet of things refers to the interconnection of the network of various devices that can recognize, collect and transfer data over the internet...

13 minutes read.

Top 14 Material Design Lite Interview Questions for 2024

1) What is Material Design Lite? Material Design Lite is UI component Library. It is created with CSS, JavaScript and HTML. It is used for design purpose. It is developed by...

3 minutes read.

Top 25 Oracle DBA Interview Question for 2024

1) What is an Oracle Instance? Database instance is a set of memory structures that manages database file. When an instance is started Oracle database allocate memory area called SGA (System...

4 minutes read.

Top 16 OpenStack Interview Questions for 2024

Most Frequently Asked OpenStack Interview Questions and Answers for Freshers 1. Describe OpenStack. OpenStack is designed as the future of cloud computing and developed as free and open-source software that facilitates a...

8 minutes read.

Top 20 HTTP Interview Questions for 2024

1) What is HTTP? HTTP stands for Hypertext Transfer Protocol. It is a set of rules for transferring of data on WWW (World Wide Web). 2) What are the basic Features of...

4 minutes read.

Top 10 Java Swing Interview Questions for 2024

1) What is Java Swing? It is a part of JFC (Java Foundation Classess) that is used to create window-based applications. Java Swing components are platform independent and lightweight . 2) What is...

3 minutes read.

Top 18 UiPath Interview Questions for 2024

RPA UiPath Interview Questions and Answers for Fresher  1. What is RPA? RPA is an acronym for Robotic Process Automation. Robotic In RPA, Robotic is termed as an entity or machine which tries to...

7 minutes read.

Top 30 WordPress Interview Questions for 2024

Most Frequently asked WordPress Interview Questions and Answers 2019 1) What is WordPress? WordPress is an open-source CMS (Content Management System) and a blogging tool. It is used to create web sites and...

5 minutes read.

Top 14 Web icon Interview Questions for 2024

1) What is Web Icon? Web Icon is a symbol that is used to represent a specific action or a capability on a webpage. It is used in documents as well...

5 minutes read.

Top 15 Struts Interview Questions for 2024

1) What are the Features of Struts 2? Features of Struts 2 are: Configurable MVC components POJO based actions AJAX support Integration support Various Result Types Various Tag support Theme and...

3 minutes read.

Top 27 JavaScript Interview Questions for 2024

1) Define Undeclared and Undefined Variables? Undeclared variable are defined as these variable is neither defined nor exist in the program. If program calls this variable then it causes Runtime error. Undefined variable...

5 minutes read.

Top 15 iOS (iPhone, iPad) Interview Questions for 2024

Top 20 Most Frequently asked iOS Interview Questions and Answers 1) What is iOS? iOS is a mobile operating system developed by Apple Inc. iOS offers iPhone and iPad application development using...

3 minutes read.

Top 25 jQuery Interview Questions for 2024

Most Frequently asked jQuery Interview Questions and Answers for Fresher and Experienced 1) Define Find and Children Method? In DOM tree if you have to find all the method we use Find...

4 minutes read.

Top 15 C Interview Questions for 2024

1) What are different storage class specifiers in C? Register,auto, static, extern are the storage class specifiers in C. 2) What is scope of a variable? How are variables scoped in C? Scope...

3 minutes read.

Top 30 Fortran Interview Questions for 2024

1) What is Fortran? Fortran is general purpose, high-level programming language which is used for numeric and scientific computing. 2) What are the features of Fortran programming language? Features of Fortran language are: ...

4 minutes read.