Vue JS MCQ (Multiple Choice Questions)

This set of Multiple Choice Questions & Answers (MCQs) focuses on “Vue JS”.

1. What is Vue JS?
a) Programming Language
b) Directives
c) Scripting Language
d) A framework
View Answer

Answer: d
Explanation: Vue.js is an open-source front-end JavaScript framework for building user interfaces and single-page applications.

2. Which of the following is the correct definition of Vue JS?
a) Vue.js is a JavaScript library that makes traversing and administering the HTML DOM tree, event handling, CSS activity, and Ajax easier
b) Vue.js is an open-source JavaScript front-end framework for creating user interfaces
c) Vue.js is a JavaScript library for creating user interfaces that are open-source
d) Vue.js is a cross-platform, open-source JavaScript run-time environment that executes JavaScript code outside of a web browser
View Answer

Answer: b
Explanation: Vue.js is an open-source JavaScript front-end framework for creating user interfaces.

3. Vue.JS was created by which of the following companies?
a) Facebook
b) Google
c) Microsoft
d) Samsung
View Answer

Answer: b
Explanation: Vue was created by Evan You after working for Google using AngularJS in a various projects.
advertisement
advertisement

4. Which of the following is the full-form of MVVM?
a) Model-View-Value Model
b) Module-Value-View Model
c) Model-View-View Model
d) Model-View-View Module
View Answer

Answer: c
Explanation: The MVVM design allows for the development of the graphical user interface to be separated from the rest of the application using mark-up language or GUI code. Model–View–ViewModel is the full form of MVVM.

5. Which of the following method does not represent the non-mutation?
a) Concat() Method
b) Reverse() Method
c) Splice() Method
d) None of the mentioned
View Answer

Answer: b
Explanation: The Reverse() method does not represent the non-mutation.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. Which of the following method is an array detection mutation method?
a) Concat() Method
b) Reverse() Method
c) new() Method
d) None of the mentioned
View Answer

Answer: c
Explanation: As the name suggests, mutation methods modifies the original array. The array mutation methods which trigger view updates are push(), pop(), shift(), unshift(), splice(), sort(), reverse()

7. Which of the following syntax is correct for creating a Vue.js instance?
a) var text = new instance ({//options})
b) var text = new object ({//options})
c) var text = new class ({//options})
d) var text = new Vue({// options })
View Answer

Answer: d
Explanation: Whenever a new Vue project is created, the Vue instance gets activated by default in the main.js file. Syntax:

var vm = new Vue({  
  // options  
})  
advertisement

8. Which keyword is used to create a constant in Vue.JS?
a) constant
b) int
c) const
d) define
View Answer

Answer: c
Explanation: To create constant const keyword is used. The best practice is to create a seperate file for defining consants.

9. Which of the following data binding interpolation is known as “Mustache” syntax?
a) v-model
b) [[]] c) {{}}
d) v-on
View Answer

Answer: c
Explanation: The mustache syntax, which uses double curly braces, is the most basic variant. This would result in a one-way data connection between the model and the template. In the template, the raw value is displayed.
advertisement

10. What happens when a View Model is destroyed?
a) doesn’t affect even listeners
b) all event listeners are should be manually removed
c) all event listeners are automatically removed
d) none of the mentioned
View Answer

Answer: c
Explanation: A ViewModel code can be of pure logic and DOM-free because you don’t have to manually attach event listeners in JS. This makes testing a lot easier. All event listeners are automatically removed when a ViewModel is destroyed.

Sanfoundry Global Education & Learning Series – Javascript Programming.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.