Google News
logo
Backbone - Quiz(MCQ)
A)
John Resig
B)
Rasmus Lerdorf
C)
Jeremy Ashkenas
D)
Guido van Rossum

Correct Answer :   Jeremy Ashkenas


Explanation :

Backbone.js is a JavaScript library with a RESTful JSON interface and is based on the model–view–controller application design paradigm. Backbone is known for being lightweight, as its only hard dependency is on one JavaScript library, Underscore.js, plus jQuery for use of the full library.

It is designed for developing single-page web applications, and for keeping various parts of web applications (e.g. multiple clients and the server) synchronized. Backbone was created by Jeremy Ashkenas, who is also known for CoffeeScript and Underscore.js.
 
Initial release : October 13, 2010

A)
October 13, 2009
B)
October 13, 2010
C)
October 13, 2011
D)
October 13, 2012

Correct Answer :   October 13, 2010

A)
Model
B)
View
C)
Collection
D)
All of the above

Correct Answer :   All of the above


Explanation : All of the above are the main components of Backbone.js.

A)
With jQuery, Backbone.js has a soft dependency.
B)
When the model changes, it can update the HTML of your application automatically.
C)
JS has a hard dependency with underscore.js to make it more functional and supporting.
D)
All of the above.

Correct Answer :   All of the above.

A)
var Todo = Backbone.Model.extend({}); var todo1 = new Todo(); console.log(JSON.stringify(todo1)); var todo2 = new Todo({ title: 'Check the attributes of both model instances in the console.', completed: true }); console.log(JSON.stringify(todo2));
B)
var Todo = Backbone.Model.extend({}); var todo1 = new Todo(); console.log(JSON.stringify(todo11)); var todo = new Todo({ title: 'Check the attributes of both model instances in the console.', completed: true }); console.log(JSON.stringify(todo2));
C)
var Todo = Backbone.Model.extend({}); var todo1 = new Todo(); console.log(JSON.stringify(todo11)); var todo = new Todo({ title: 'Check the attributes of both model instances in the console.', completed: true }); console.log(JSON.stringify(todo2));
D)
None of the Above

Correct Answer :   var Todo = Backbone.Model.extend({}); var todo1 = new Todo(); console.log(JSON.stringify(todo1)); var todo2 = new Todo({ title: 'Check the attributes of both model instances in the console.', completed: true }); console.log(JSON.stringify(todo2));

A)
The ModelBinder class is used to handle routers.
B)
The ModelBinder class is used to hide the models and views.
C)
The ModelBinder class is used to make a synchronization process of views and models together.
D)
None of the Above

Correct Answer :   The ModelBinder class is used to make a synchronization process of views and models together.


Explanation : The ModelBinder class is used to make a synchronization process of views and models together.

A)
Change Triggers
B)
ModelSetOptions
C)
InitialCopyDirection
D)
All of the above.

Correct Answer :   All of the above.


Explanation : All of the above are the configuration options available in Backbone.js.

A)
If the id attribute of the model is null, Backbone.js sends a POST request to the urlRoot of the Server using the save() method.
B)
If the id attribute of the model is not null, Backbone.js sends a PUT request instead of a POST request using the save() method.
C)
If we instantiate a model with an id, Backbone.js automatically performs a GET request to the urlRoot + '/id' using the fetch() method.
D)
All of the Above.

Correct Answer :   All of the Above.

A)
JavaScript, jQuery, js
B)
jQuery, Backbone.js, Underscore
C)
Underscore, JavaScript, jQuery
D)
None of the above.

Correct Answer :   jQuery, Backbone.js, Underscore


Explanation : The three js files required to set up Backbone.js are jQuery, Backbone.js, Underscore, etc.

A)
When Backbone.js wants to save or read a model to the Server, it calls out a function called Backbone.sync.
B)
When Backbone wants to save or read a view to the Server, it calls out a function called Backbone.sync.
C)
When Backbone wants to save or read an event to the Server it calls out a function called Backbone.sync.
D)
All of the above.

Correct Answer :   When Backbone.js wants to save or read a model to the Server, it calls out a function called Backbone.sync.

A)
Views are not HTML.
B)
It is a description of a model.
C)
The HTML code comes from templates.
D)
All of the above.

Correct Answer :   All of the above.


Explanation : All of the above options specify the view in Backbone.js.

A)
Events reflect the state of the model.
B)
They give the object the ability to bind and trigger custom-named events.
C)
The events are modules in Backbone.js that can be mixed into any object.
D)
All of the above.

Correct Answer :   All of the above.

A)
Converters are the type of compilers that are used to convert one programming language into another.
B)
The converter is an interface describing a Java class that can perform Object-to-String and String-to-Object conversions between model data objects and a String representation of those objects.
C)
When a model's attribute is copied to an HTML element or when an HTML element's value is copied into a model's attribute, a function is called; this function is known as a converter in Backbone Js.
D)
None of the above.

Correct Answer :   When a model's attribute is copied to an HTML element or when an HTML element's value is copied into a model's attribute, a function is called; this function is known as a converter in Backbone Js.

A)
Router = Backbone.Route.extend({ route: { ": 'index' }, index: function(){ $(document.body).append("root index route"); } });
B)
Router = Backbone.Router.extend({ routes: { ": 'index' }, index: function(){ $(document.body).append("root index route"); } });
C)
Route = Backbone.Router.extend({ route: { ": 'index' }, index: function(){ $(document.body).append("root index route"); } });
D)
All of the above.

Correct Answer :   Router = Backbone.Router.extend({ routes: { ": 'index' }, index: function(){ $(document.body).append("root index route"); } });

A)
The scoping rules can be redefined if the views are complex.
B)
Modelbinder allows the developer to define the scope when binding is created using J-Query.
C)
In some of the cases, we can rely on the default scoping rules based on the name attribute of HTML.
D)
All of the above.

Correct Answer :   All of the above.

A)
first(20)
B)
collection(20)
C)
first(collection, 20)
D)
All of the above.

Correct Answer :   first(20)

A)
"destroy"(model, collection, options)
B)
"sync"(model_or_collection, resp, options)
C)
"change:[attribute]"(model, value, options)
D)
"request"(model_or_collection, xhr, options)

Correct Answer :   "sync"(model_or_collection, resp, options)

A)
Tojson does not return a JSON string.
B)
Tojson returns a shallow copy of the model's attribute for JSON stringification.
C)
The Tojson function is used for persistence, serialization, and for augmentation before being sent to the server.
D)
All of the above.

Correct Answer :   All of the above.

A)
Model
B)
Method
C)
Options
D)
All of the above.

Correct Answer :   All of the above.

A)
sort
B)
each
C)
map
D)
every

Correct Answer :   sort

A)
var Type = Backbone.Model.extend({ url : "/api/SomeRoute" });
B)
var Type = Backbone.Model.extend({ urlRoot : "/api/SomeRoute" });
C)
Both (A) and (B)
D)
None of the above.

Correct Answer :   var Type = Backbone.Model.extend({ urlRoot : "/api/SomeRoute" });

A)
Models are not shared between different views.
B)
The application models don't change very often.
C)
Application pages are frequently refreshed from scratch from the server.
D)
All of the above.

Correct Answer :   All of the above.


Explanation : All of the above are typical problems you might face with the Backbone.js view code.

A)
1
B)
2
C)
3
D)
None of the above

Correct Answer :   3

A)
Once
B)
Listen to
C)
Stop listening
D)
All the above

Correct Answer :   All the above

A)
Views are not HTML
B)
The view is a description of a model
C)
A View is a JavaScript object that manages specific DOM elements
D)
All of the above

Correct Answer :   All of the above

26 .
In relation to RequireJS configuration options, which of the following is the correct option that is used for setting the baser to point to the app directory?
A)
require.config({
baseUrl:
B)
require.config({
baseUrl=
C)
require.config({
baseUrl
D)
None of the above.

Correct Answer :  

require.config({
baseUrl:

A)
npm install -g y
B)
npm install -g yeoman
C)
npm install -g yo
D)
npm install -g yeo

Correct Answer :   npm install -g yeoman

A)
on
B)
for
C)
set
D)
this

Correct Answer :   on

A)
npm install grunt -g -cli
B)
npm install grunt-cli —g
C)
npm install -g grunt-cli
D)
npm install -g —cli-grunt

Correct Answer :   npm install -g grunt-cli

A)
isValid
B)
invalid
C)
validation
D)
validationError

Correct Answer :   invalid

A)
var Type = Backbone.Model.extend({ url : "" });
B)
var Type = Backbone.Model.extend({ url : "/api/SomeRoute" });
C)
var Type = Backbone.Model.extend({ urlRoot : "/api/SomeRoute" });
D)
None of the above

Correct Answer :   var Type = Backbone.Model.extend({ urlRoot : "/api/SomeRoute" });

A)
first(collection, 20)
B)
first.collection(20)
C)
first.collection[20]
D)
collection.first(20)

Correct Answer :   collection.first(20)

A)
App.Route = Backbone.Router.extend({ route: { '': 'index' }, index: function(){ $(document.body).append("root index route"); } });
B)
App.Router = Backbone.Router.extend({ routes: { '': 'index' }, index: function(){ $(document.body).append("root index route"); } });
C)
App.Router = Backbone.Route.extend({ route: { '': 'index' }, index: function(){ $(document.body).append("root index route"); } });
D)
All of the above

Correct Answer :   App.Router = Backbone.Router.extend({ routes: { '': 'index' }, index: function(){ $(document.body).append("root index route"); } });

A)
When Backbone wants to save or read a view to the server it calls out a function called as Backbone.sync.
B)
When Backbone wants to save or read a event to the server it calls out a function called as Backbone.sync.
C)
When Backbone wants to save or read a model to the server it calls out a function called as Backbone.sync.
D)
All of the above

Correct Answer :   When Backbone wants to save or read a model to the server it calls out a function called as Backbone.sync.

A)
events
B)
remove view
C)
delegateEvents
D)
undelegateEvents

Correct Answer :   undelegateEvents

A)
collection.get()
B)
collection.add()
C)
collection.fetch()
D)
collection.remove()

Correct Answer :   collection.fetch()

A)
@company_location= new window.ArtistLocationForm({template: JST["templates/new_company_location"]})
B)
@company_location= new window.ArtistLocationForm({templates: JST["template/new_company_location"]})
C)
render: function(){ var templateFn = this.option.template || this.template; this.$el.html(templateFn(this.model.attributes)); return this; }
D)
render: function(){ var templateFn = this.options.template || this.template; this.$el.html(templateFn(this.model.attributes)); return this; }

Correct Answer :   render: function(){ var templateFn = this.options.template || this.template; this.$el.html(templateFn(this.model.attributes)); return this; }

A)
var Todo = Backbone.Model.extend({}); var todo1 = new Todo(); console.log(JSON.stringify(todo11)); var todo = new Todo({ title: 'Check the attributes of both model instances in the console.', completed: true }); console.log(JSON.stringify(todo2));
B)
var Todo = Backbone.Model.extend({}); var todo1 = new Todo(); console.log(JSON.stringify(todo1)); var todo2 = new Todo({ title: 'Check the attributes of both model instances in the console.', completed: true }); console.log(JSON.stringify(todo2));
C)
var Todo = Backbone.Model.extend({}); var todo1 = new Todo(); console.log(JSON.stringify(todo11)); var todo = new Todo({ title: 'Check the attributes of both model instances in the console.', completed: true }); console.log(JSON.stringify(todo2));
D)
All of the above

Correct Answer :   var Todo = Backbone.Model.extend({}); var todo1 = new Todo(); console.log(JSON.stringify(todo1)); var todo2 = new Todo({ title: 'Check the attributes of both model instances in the console.', completed: true }); console.log(JSON.stringify(todo2));

A)
omit
B)
key
C)
pick
D)
value

Correct Answer :   omit

A)
QUnit phantomjs.runner.js [url-of-your-qunit—testsuite]
B)
phantomjs.runner.js [timeout-in-seconds] [url-of-your-qunit-testsuite]
C)
phantomjs runner.js [url—of—your-qunit-testsuite] [timeout—in-seconds]
D)
QUnit phantomjs runner.js [timeout-in-seconds] [urI-of-your-qunit-testsuite]

Correct Answer :   phantomjs.runner.js [timeout-in-seconds] [url-of-your-qunit-testsuite]

A)
QUnit.testDone = function(result, failures, message)[ ];
B)
QUnitJog = function(name, failure, results, message)[ };
C)
QUnitJog = function(results, message)[ ];
D)
QUnit.testDone = function(name, failures, message)[ }:

Correct Answer :   QUnitJog = function(results, message)[ ];

A)
to Have Been triggered
B)
to Have Been Triggered( event)
C)
to Have Been Triggered( name. event)
D)
to Have Been Triggered( event, handler)

Correct Answer :   to Have Been Triggered( event, handler)

A)
on('change',)
B)
on('change', )
C)
on('function','change')
D)
on('function', 'change', )

Correct Answer :   on('change',)

A)
on Close
B)
on Render
C)
on Before Render
D)
on Before item Added

Correct Answer :   on Close

A)
collection.at(begin. model)
B)
collection.unshift(model. [options])
C)
collection.push(model, [options])
D)
collection.get(id. model, [options])

Correct Answer :   collection.unshift(model. [options])

49 .
While using Backbonejs, which of the following syntaxes is used for extending any basic objects with the Backbone event capability?
A)
_.extend(route. Backbone.Events);
B)
var object = {j;
_.extend(object. route. Backbone.Events);
var object = {};
C)
_.extend(Backbone.Events);
var object = {};
D)
_.extend(object, Backbone.Events);
var object = {};

Correct Answer :  

_.extend(Backbone.Events);
var object = {};

A)
events
B)
setElement()
C)
delegateEvents()
D)
undelegateEvents()

Correct Answer :   delegateEvents()

A)
deequual(actual, expected)
B)
deequual(actual. expected. message)
C)
deequuallactual, expected. condition)
D)
deequual(actual. expected. condition. message)

Correct Answer :   deequual(actual, expected)

A)
on Render
B)
on Before Render
C)
on Before item Added
D)
None of the Above

Correct Answer :   on Render

A)
Node.js
B)
json2.js
C)
Angularjs
D)
Underscore.js

Correct Answer :   json2.js

A)
var myViewExample = new ExampleView();
B)
var myViewExample =View ExampleView();
C)
myViewExample = new View ExampleView();
D)
myViewExampIe = new ExampleView();

Correct Answer :   myViewExampIe = new ExampleView();

A)
var myCollection = new Collection(); myCollection.url = this.model.url() + '/feed'; myCollection.fetch();
B)
var myCollection = new Collection(); myCollection.url = this.model.url() + '/slient'; myCollection.fetch();
C)
var myCollection = Backbone.Collection.extend({ parse: function(response) { return response.slice(0,20); } });
D)
All of the above

Correct Answer :   var myCollection = Backbone.Collection.extend({ parse: function(response) { return response.slice(0,20); } });

A)
boundAttribute
B)
modelSetOptions
C)
InitialCopyDirection
D)
All of the above

Correct Answer :   All of the above

A)
Key
B)
Hash
C)
Listener
D)
Dispatch

Correct Answer :   Hash

A)
trigger
B)
once
C)
listen To
D)
stop listening

Correct Answer :   trigger

A)
init
B)
new
C)
create
D)
initiate

Correct Answer :   create

A)
*splats
B)
#hashes
C)
Both (A) and (B)
D)
:params

Correct Answer :   :params

A)
Backbone.pushState State
B)
window.history.push State
C)
Backbone .history.push State
D)
Backbone. window.push State

Correct Answer :   window.history.push State

A)
ead => GET /collection[/id]
B)
create => POST /collection
C)
update => PUT /collection/id
D)
All of the above

Correct Answer :   All of the above

A)
create, update, patch, delete, read
B)
create, update, delete, get
C)
create,update,delete, read
D)
create, update, trigger, delete, read

Correct Answer :   create, update, patch, delete, read

A)
Load(), save()
B)
Read(), save()
C)
Fetch(), save()
D)
Send(), save()

Correct Answer :   Fetch(), save()

A)
Backbone.history.init();
B)
Backbone.history.create();
C)
Backbone.history.start();
D)
Backbone.history.enable();

Correct Answer :   Backbone.history.start();

A)
collection.get()
B)
collection.fetch()
C)
collection.getJSON(url)
D)
collection.retrive()

Correct Answer :   collection.retrive()

A)
object.listen(event,callback)
B)
object.on(event, callback)
C)
object.trigger(event,callback)
D)
object.addListener(event,callback)

Correct Answer :   object.on(event, callback)

A)
deleteList: function() { if (confirm(delete a list?')) { bTask.views.activeListMenuItem.model.destroy(); } return false; }
B)
deleteList: function() { if (confirm(delete a list?')) { bTask.models.activeListMenuItem.model.destroy(); } return false; }
C)
deleteList: function() { if (confirm(delete a list?')) { bTask.views.activeListMenuItem.model.removeAll(); } return false; }
D)
None of the above

Correct Answer :   deleteList: function() { if (confirm(delete a list?')) { bTask.views.activeListMenuItem.model.destroy(); } return false; }