Page 415 - Web_Application_v2.0_C12_Fb
P. 415
Viva Voce Questions
21 st Century #Communication
Skills
1. What is the difference between var, let, and const in JavaScript?
Ans. The difference between var, let, and const in JavaScript are:
• var: Used for variable declarations in JavaScript. It has function-level scope, meaning it is accessible
throughout the function in which it’s declared.
• let: Let has block-level scope, meaning it is only accessible within the block in which it’s declared.
• const: Const is used to declare constants that cannot be reassigned after initialisation.
2. How do you create a function in JavaScript?
Ans. You create a function using the function keyword followed by the function name and parameters.
3. What is the use of the return statement in a function?
Ans. The return statement is used to send a value from a function back to the calling code. Once the return
statement is executed, the function stops running.
4. Explain how event handling works in JavaScript.
Ans. Event handling in JavaScript allows you to execute functions in response to user interactions like clicks,
keypresses, etc. You can attach an event listener to an HTML element.
5. What is the difference between undefined and null in JavaScript?
Ans. The difference between undefined and null are:
• undefined: A variable that has been declared but not assigned a value.
• null: A variable explicitly assigned a “no value” state, representing the absence of any object value.
6. Explain the concept of JavaScript objects.
Ans. JavaScript objects are collections of key-value pairs. Each key is a string (or symbol), and the value can
be any data type.
7. What is the purpose of replace() and replaceAll() string methods?
Ans. replace(): Replaces the first occurrence of a substring.
replaceAll(): Replaces all occurrences of a substring.
8. What are JavaScript string methods used to extract a portion of a string?
Ans. The slice() and substring() methods are used to extract parts of a string.
9. What are arrays in JavaScript? How do you manipulate them?
Ans. Arrays are ordered collections of data, which can be of any type. You can manipulate arrays using
methods such as push(), pop(), shift(), and unshift().
10. What is the purpose of JavaScript’s Math object?
Ans. The Math object in JavaScript provides built-in methods and properties for performing mathematical
operations such as calculations, rounding, generating random numbers, and finding minimum or
maximum values.
11. What is the importance of graphic designing in various fields?
Ans. Graphic designing is essential in fields like marketing, education, entertainment, and business as it helps
create visually appealing content that communicates messages effectively.
12. What are the key elements and principles of design in Canva?
Ans. The key elements include colour, typography, images, and shapes, while the principles involve balance,
contrast, alignment, and repetition to create a visually engaging design.
13. What measures can individuals take to protect their data privacy online?
Ans. Individuals can protect their data privacy by using strong passwords, enabling two-factor authentication,
avoiding public Wi-Fi for sensitive activities, keeping software up to date.
Viva Voce Questions 413

