Mobile Development and JavaScript | Module 1
Course Name: Mobile Development and JavaScript
Course Link: Mobile Development and JavaScript
These are Mobile Development and JavaScript Week 1 Coursera Answers
Module 1 Quiz: Introduction to JavaScript
Q1. DevTools console is useful for doing which of the following?
- Running Javascript in a web browser.
- Downloading packages.
- Installing npm.
- Testing your code.
Answer: Running Javascript in a web browser.
Q2. You can run JavaScript in what web browser tool?
- GUI
- Package manager
- DevTools Console
- console.log
Answer: DevTools Console
Q3. // is used to indicate what kind of information in javascript?
- inline comments
- unfinished code
- multi-line comments
- test code
Answer: inline comments
These are Mobile Development and JavaScript Week 1 Coursera Answers
Q4. /* Comment */ is used to indicate what kind of information in javascript?
- inline comments
- test code
- multi-line comments
- unfinished code
Answer: multi-line comments
Q5. Which of the following data types would you use to store a true or false value?
- booleans
- numbers
- function
- string
Answer: booleans
Q6. Which of the following operators would you add in the place of XX to output Not zero?
var a = 4;
var b = 6;
if (a > 0 XX b > 0) {
console.log = “Not zero”;
}
- &
- &&
- ||
- \
Answer: &&
These are Mobile Development and JavaScript Week 1 Coursera Answers
Q7. What is the primary difference between == and ===?
- == is used for numbers and === is used for strings.
- There is no difference between == and ===.
- == operator compares the values as well as the data types of the operands.
- === operator compares the values as well as the data types of the operands.
Answer: === operator compares the values as well as the data types of the operands.
Q8. How many times will the following code print the word Hello?
for(var i = 0; i <= 5; i++)
{for(var j = 0; j < 3; j++){console.log(“Hello”);}}
- 15
- 8
- 0
- 18
Answer: 18
Q9. How many times will the following code print the word Hello?
for(var i = 10; i >=1; i–) { console.log(“Hello”); }
- 10
- 9
- 0
- 1
Answer: 10
These are Mobile Development and JavaScript Week 1 Coursera Answers
Q10. What will print out when the following code runs?
var i = 3; var j = 5; if(i == 3 && j == 5) { console.log(“Hello”); } else { console.log(“Goodbye”); }
- Hello
- undefined
- Nothing
- Goodbye
Answer: Hello, Goodbye
Q11. What will print out when the following code runs?
var i = 7; var j = 2; if(i !== 7 || j !== 5) { console.log(“Hello”); } else { console.log(“Goodbye”); }
- Nothing
- undefined
- Goodbye
- Hello
Answer: Hello
Q12. What will print out when the following code runs?
var i = 7; var j = 6; if(i < 7 || j < 5) { console.log(“Hello”); } else { console.log(“Goodbye”); }
- Hello
- Goodbye
- undefined
- Nothing
Answer: Goodbye
These are Mobile Development and JavaScript Week 1 Coursera Answers
Q13. True or False: When you add the NOT operator before a boolean value, the returned value is the opposite of the boolean value.
- False
- True
Answer: True
Q14. What is the output of the following statement?
7 !== 9
- false
- undefined
- syntaxError
- true
Answer: true
Q15. What will be the output of the following code block?
var i = 5;
while (i > 0) {
console.log(i);
i = i - 1;
};
- It will count backwards from 5.
- It will count to 5.
- undefined
- i = 0
Answer: It will count to 5.
These are Mobile Development and JavaScript Week 1 Coursera Answers
More Weeks of this course: Click Here
More Coursera Courses: http://progiez.com/coursera