Mobile Development and JavaScript | Module 2
Course Name: Mobile Development and JavaScript
Course Link: Mobile Development and JavaScript
These are Mobile Development and JavaScript Week 2 Coursera Answers
Module 2 Quiz: The Building Blocks of a Program
Q1. Which part of the below statement is an object?
const car = {type:”Ford”, model:”Model T”, color:”white”};
- type
- color
- car
- model
Answer: car
Q2. True or False: SyntaxError in JavaScript cannot be caught using the try-catch block.
- True
- False
Answer: False
Q3. What value is printed when the following code runs?
var burger = [“bun”, “beef”, “lettuce”, “tomato sauce”, “onion”, “bun”]; console.log(burger[2]);
- bun
- beef
- tomato sauce
- lettuce
Answer: Please login to see answer.
These are Mobile Development and JavaScript Week 2 Coursera Answers
Q4. In the following code, what data type does start: function() {} represent?
var bicycle = { wheels: 2, start: function() { }, stop: function() { } };
- Array
- Method
- Property
- Object
Answer: Please login to see answer.
Q5. When the error is thrown, the code will do what?
try { throw new Error(); console.log(‘Hello’); } catch(err) { console.log(‘Goodbye’); }
- Execute the code inside the throw statement.
- Execute the code inside the catch statement.
- Print the type of error to the console.
- Print new Error to the console.
Answer: Please login to see answer.
Q6. Which of the following is used to run a block of code that may output an error without stopping the program?
- throw
- catch
- ErrorHandling
- try
Answer: Please login to see answer.
These are Mobile Development and JavaScript Week 2 Coursera Answers
Q7. When the following code runs, what will print out?
try { throw new Error(); console.log(‘Hello’); } catch(err) { console.log(‘Goodbye’); }
- Hello
- Goodbye
- err
- catch failed
Answer: Please login to see answer.
Q8. What error gets thrown when, for example, one tries to use variables that haven’t been declared anywhere?
- TypeError
- ReferenceError
- RangeError
- SyntaxError
Answer: Please login to see answer.
Q9. Which of the below will be the output of the following code?
(10).toString(100);
- .1
- SyntaxError
- RangeError
- undefined
Answer: Please login to see answer.
These are Mobile Development and JavaScript Week 2 Coursera Answers
Q10. The statement below evaluates to which of the following?
const value = null;
console.log(value);
- value
- null
- undefined
- error
Answer: Please login to see answer.
Q10. What will be printed when the following code runs?
var result; console.log(result);
- result
- null
- undefined
- 0
Answer: Please login to see answer.
Q12. Which of the following statements will evaluate to false?
- null == undefined;
- !null;
- null === undefined;
- null === null;
Answer: Please login to see answer.
These are Mobile Development and JavaScript Week 2 Coursera Answers
Q13. A method returns undefined if the variable that is being evaluated does not have which of the following?
- A null value
- Correct syntax
- A defined value
- A method cannot return undefined.
Answer: Please login to see answer.
Q14. What represents the intentional absence of any object value?
- undefined
- noValue
- null
- “”
Answer: Please login to see answer.
Q15. Which of the following is used to output an error and pass control to the first catch block?
- ErrorHandling
- try
- err
- throw
Answer: Please login to see answer.
These are Mobile Development and JavaScript Week 2 Coursera Answers
More Weeks of this course: Click Here
More Coursera Courses: http://progiez.com/coursera
![Mobile Development and JavaScript | Module 2 1 Mobile Development and JavaScript Week 2 Coursera](https://progiez.com/wp-content/uploads/2023/01/cropped-3-progiez-logo.png-1.png)