Our team has conducted extensive research to compile a set of BackBone.js MCQs. We encourage you to test your BackBone.js knowledge by answering these multiple-choice questions provided below.
Simply scroll down to begin!
In Backbonejs, which of the following Options is the correct syntax of creating 8 Fruit Object having default attributes name with value Mango, and season with value Summer are also added, and the message “Fruits are healthy!" is written to console?
A.
Fruit = Backbone.Model.extend({
initialize.function()[
console.log(
B.
Fruit = Backbone.Model.extend({
initialize: function0[
console.log('Fruits are healthy!‘);
l.
defaults:{
name: 'Mango',
season: 'Summer'
I
1):
C.
Fruit = Backbone.Model.extend({
lunction:initialize0[
console.log('Fruits are healthy!');
],
defaults: [
name: 'Mango',
season = 'Summer'
}
1):
D.
None of the above.
In relation to RequireJS configuration options, which of the following is the correct option that is used for setting the baseUrl to point to the app directory?
A.
require.config({
baseUrl:
B.
require.config({
baseUrl=
C.
require.config({
baseUrl
D.
None of the above.
A. npm install -g yeoman
B. npm install -g yo
C. npm install -g yeo
D. npm install -g y
A. set
B. for
C. on
D. this
A. npm install grunt -g -cli
B. npm install -g grunt-cli
C. npm install grunt-cli —g
D. npm install -g —cli-grunt
A. model
B. xhr
C. value
D. options
A. subString
B. substr
C. Split
D. trim
In relation to running QUnit without a browser. which of the following options is the correct command that is entered to the command line for obtaining the PhantomJS Runner plug-in for QUnit?
A.
phantomjs.runner.js [timeout-in-seconds] [url-of-your-qunit-testsuite]
B.
phantomjs runner.js [url—of—your-qunit-testsuite] [timeout—in-seconds]
C.
QUnit phantomjs.runner.js [url-of-your-qunit—testsuite]
D.
QUnit phantomjs runner.js [timeout-in-seconds] [urI-of-your-qunit-testsuite]
Which of the following options is the correct OUnit callback that runs after each assertion and provides the result of the test case (either error or log) along with the message?
A.
QUnitJog = function(results, message)[
];
B.
QUnitJog = function(name, failure, results, message)[
};
C.
QUnit.testDone = function(name, failures, message)[
}:
D.
QUnit.testDone = function(result, failures, message)[
];
A. toHaveBeenTriggered( event, handler)
B. toHaveBeenTriggered( name. event)
C. toHaveBeenTriggered( event)
D. toHaveBeenTriggeredO
A. map
B. shim
C. deps
D. config
A. on('change',
B. on('function','change')
C. on('change',
D. on('function', 'change',
A. onBeforeltemAdded
B. onRender
C. onClose
D. onBeforeRender
A. collection.at(begin. model)
B. collection.get(id. model, [options])
C. collection.unshift(model. [options])
D. collection.push(model, [options])
A. Log
B. with
C. unless
D. if else
A. name
B. string
C. jOuerySelector
D. className
A. fetch
B. Sync
C. validate
D. Set
A. data
B. template
C. model
D. el
While using Backbonejs, which of the following syntaxes is used for extending any basic objects with the Backbone event capability?
A.
var object = {j;
_.extend(object. route. Backbone.Events);
B.
var object = {};
_.extend(object, Backbone.Events);
C.
var object = {};
_.extend(Backbone.Events);
D.
var object = {};
_.extend(route. Backbone.Events);
A. Backbone.js View is used for specifying how to display from application.
B. Backbone.js View contains HTML markup for the application.
C. Backbone.js View presents model's data to the user.
D. Both the statements a and b are incorrect.
A. delegateEvents(
B. events
C. undelegateEvents(
D. setElement(
A. deequual(actual. expected. condition. message)
B. deequuallactual, expected. condition)
C. deequual(actual, expected)
D. deequual(actual. expected. message)
A. onBeforeRender
B. onRender
C. onBeforeltemAdded
D. None of the above.
Select if True or False.
Backbone.trackit cannot be applied to individual model objects, using the startTracking function.
A.
True
B.
False
Which of the following modules are the parts of Backbone.js?
i) Events
ii) HTTPS Request
iii) Router
iv) HTTP Request
A.
Only options i). ii) and iii).
B.
Only options i). iii) and iv).
C.
Only options ii), iii) and iv).
D.
All options i). ii). iii) and iv).
With regard to dealing with files in Grunt, which of the following Options is the correct property that is used to remove all path parts from the dest paths?
Note: The given options are the properties that can be used when expand = true.
A.
ext
B.
Flatten
C.
cwd
D.
dest
A. *
B. ?
C. !
D. &
A. Node.js
B. Angulanjs
C. json2.js
D. Underscore.js
A. hashchange events
B. HTML5 pushState method
C. Both Options a and b.
D. Neither option a nor b.
A. myViewExampIe = new ExampleView();
B. var myViewExample =View ExampleView();
C. myViewExample = new View ExampleView();
D. var myViewExample = new ExampleView();
Which of the following options is the correct syntax for creating a model object named ExampleModel in Backbone.js?
A.
ExampleModel = Backbone.Model.extend({
llobject properties
J):
B.
New ExampleModel = Backboneextend. Model ([
llobject properties
i);
C.
ExampleModel = Model.extend({
llobject properties
1);
D.
ExampleModel = Backbone.Model.new([
llobject properties
i);
A. Backbone.Router.extent();
B. Backbone.View.extent();
C. Backbone.Event.start0;
D. Backbonehistorystartl);
A. Backbone.history.start([pushState:true}):
B. Backbone.Event.start([pushState:true});
C. Backbone.history.start([pushState= 'true‘));
D. Backbone.Router.extend([pushState= 'true'D;
A. npm install grunt —save-dev contrib-uglify
B. npm install grunt— uglify "save-dev
C. npm install grunt-uglify-contrib --save-dev
D. npm install grunt-contrib-uglify --save-dev
A. Filter
B. Dot
C. expand
D. nonuH
A. Stubs
B. Mocks
C. Test Spies
D. Fake Servers
A. Backbone.duaIStorage
B. Backbone.localStorage
C. Both Options a and b.
D. Neither option a nor b.
A. localStorage : new libraryapp LocalStorage("MyLibrary").
B. LocalStorage localStorage : new("|ibraryappzMyLibrary").
C. localStorage : new Backbone.LocalStorage("libraryappzMyLibrary").
D. var localStorage : new Backbone.LocalStorage(MyLibrary),
A. Backbone Ul
B. Backbonestickit
C. Backgrid.js
D. None of the above.
A. ModelAttrs
B. qunit—report
C. Jasmine-jQuery
D. Grunt
A. backbone-ui.js
B. backbone-ui.css
C. Both Options a and b.
D. Neither option a nor b.
A. Emitting events in case of data change.
B. Arranging data and business logic.
C. Loading and saving from the server.
D. Handling user input and listening to changes.
A. <%= %>
B. <$: $>
C. <@= @>
D. <&= &>
A. toEqual( value)
B. toMatch( regularExpression )
C. toBe( value)
D. toBeCloseTo( e, value )
A. toBeSelected(name)
B. toBe(jQuerySelector)
C. toBeChecked( jQuerySelector)
D. toHaveData ( name, jQuerySelector)
A. equal(condition, message)
B. ok(condition, message)
C. strictEqual(condition. message)
D. expect(condition. message)
A. render()
B. .setEIement()
C. $(
D. .ono
A. previous(
B. hasChanged(
C. hasChanged.previous(
D. Changed(
A. at0
B. push0
C. fetcho
D. shift()
E. model()
A. toEquaI( value)
B. toMatch( value)
C. toEqual( value. e)
D. toMatch( e, value)