Backbone.js Interview Questions – Set 02

What are the configuration options available in Backbone.js?

There are the following configuration options available in Backbone.js.

  1. modelSetOptions
  2. boundAttributes
  3. supressThrows
  4. converter
  5. change Triggers
  6. InitialCopyDirection

Which are the three js files that are required to setup Backbone.js?

Following are the three js files that you require to setup Backbone.js:

  • jQuery
  • Backbone
  • Underscore

What are the advantages of Backbone.js?

Advantages of Backbone.js:

  • You can develop a web application with Backbone.js by using JavaScript with the minimal set of data-structuring (models & collections) and user interface (views & URLs).
  • It is best for developing MVC like web applications, single page web applications or complex JavaScript web applications in an organized and structured manner without JavaScript code mixing with HTML.
  • It provides API with many functions.
  • It provides a key-value binding and custom events.
  • It facilitates you to abstract your data into models and your DOM application into views and binds the two together using events.

When and by Whom the Backbone.js was released?

Backbone.js was initially released on October 13, 2010, by Jeremy Ashkenas.

What are the functionalities of parse in Backbone.js?

The data, which is returned from the server in response to a fetch or store operation, is called parse. It is used to return the model’s data by passing into the response object.

What is the use of Backbone.js router?

Backbone.js routers are used to route the application’s URL to some particular actions and events. At least one route must be present for every defined router. It also defines the URL representation of the application’s object when web applications provide linkable, bookmarkable, and sharable URL.

What is a Converter in Backbone.js?

The Converter is a function which is used to convert the JavaScript object to a model. It is invoked when the transition is made between an HTML element and the model’s attribute.

Which is the latest stable version of Backbone.js and what is its released date?

The latest stable version of Backbone.js is 1.3.3, and it was released on April 5, 2016.

What is the function of setElement?

The Backbone.js setElement method is used to apply the backbone view to a different DOM element

Describe Backbone events?

Backbone.js event can be defined as the module which can be mixed with any object. There are following methods which are used to manipulate Backbone.js events,

  • on – It binds an event to an object and executes the callback whenever an event is fired.
  • off – It removes callback functions or all events from an object.
  • trigger – It invokes the callback functions for the given events.
  • once – It extends the backbone model class while creating your own backbone model.
  • listenTo – It informs one object to listen to an event on another object.
  • stopListening – It can be used to stop listening to events on the other objects.
  • listenToOnce – It causes the listener, to occur only once before the callback function is being removed.