Complete JavaScript Course: Build a Real World App from Scratch Educative Quiz Answers

Get Complete JavaScript Course: Build a Real World App from Scratch Educative Quiz Answers

Javascript is one of the most prominent web programming languages that really made a difference. This course aims to be a useful companion for anyone wishing to (re)discover the many facets of JavaScript. Walk with us as we take you on a journey filled with all the wonders of Javascript including:

– Basics of JavaScript with ES6

– How to traverse the DOM?

– Modify Pages and handle events

– Animate elements

You will also learn how to build a Social News web application from scratch using the three web technologies HTML, CSS and JavaScript. Before moving on to advanced concepts, we will go through the fundamentals to get a strong grip over the basics. You can also experiment with the code provided and hence, gain a higher understanding of how things work. This course is perfect for anyone who wants to learn web development and get off to a good start in the JavaScript universe or catch up with its newest evolutions. Let’s walk this (JavaScript) way!

Enroll on Educative

Quiz 1: Basics of JavaScript

Q1. Following JavaScript command shows a message in the console, an information zone available in most JavaScript environments.

  • console.show()
  • console.log()
  • console.print()
  • log.show()

Q2. Is the following statement correct?

The JavaScript language uses the number type to represent a numerical value (with or without decimals) and the string type to represent text.

  • True
  • False

Q3. Observe the following program and choose the correct output:

console.log(4 / 8);
console.log("4 / 8");
console.log("4" / "8");
  • 0.5
    4 / 8
    48
  • 0.5
    4 / 8
    0.5
  • 0.5
    0.5
    84
  • It will throw an error

Q4. Applied to two strings, the + operator performs addition if strings contain numeric values.

  • True
  • False

Q5. Is the following statement correct?

A computer program is made of several lines of code read sequentially during execution.

  • True
  • False

Q6. Is the following statement correct?

Comments (// ... or /* ... */) are non-executable parts of code.

  • True
  • False

Q7. In JavaScript, a string can be only surrounded by a pair of single quotes ('...').

  • True
  • False

Q8. Observe the following program and choose the correct output:

console.log("My name is");
/*
Jane
*/
console.log("\n, what is your name?");
  • My name is Jane, what is your name?
  • My name is Jane
    , what is your name?
  • My name is
    , what is your name?
  • My name is, what is your name?

Quiz 2: Play with Variables

Q1. Choose a correct option:

  • To give a value to a variable, we use the assignment operator =
  • For number variables, the operator -- can increment their value by 1
  • JavaScript is not a dynamically typed language.
  • All of the above

Q2. Observe the following program and try to predict the final values of its variables:

let a = 2;
a -= 1;
a++;
let b = 8;
b += 2;
const c = a + b * b;
const d = a * b + b;
const e = a * (b + b);
const f = a * b / a;
const g = b / a * a;
console.log(a, b, c, d, e, f, g);
  • a = 2 , b = 10 , c = 100 , d = 25 , e = 30 , f = 12 , g = 10
  • a = 2 , b = 10 , c = 102 , d = 30 , e = 40 , f = 10 , g = 10
  • a = 2 , b = 10 , c = 101 , d = 25 , e = 30 , f = 10 , g = 10
  • a = 2 , b = 10 , c = 100 , d = 30 , e = 40 , f = 12 , g = 10

Q3. Choose a correct option:

  • A variable is declared using the let keyword followed by the variable name
  • To declare a constant it’s better to use the const keyword
  • Variables declared with let or const are block-scoped
  • All of the above

Q4. Choose a correct option:

  • The prompt() and alert() commands deal with information input and display under the form of dialog boxes
  • Expressions may be included in strings delimited by a pair of backticks (`). Such a string is called a template literal
  • Type conversions may happen implicitly during the evaluation of an expression, or explicitly when using the Number() and String() commands, to obtain respectively a number or a string
  • All of the above

Q5. Is the following statement correct:

Type conversions can be done explicitly when using the Number() and String() commands

  • True
  • False

Q6. Observe the following program and choose the correct output:

const y = 7;
console.log(String(7) + 1);
  • 8
  • 7
  • 71
  • Error

Quiz 3: Add Conditions

Q1. Choose a correct option:

  • JavaScript contains only two types of comparison operators > and <
  • Comparison operators > and < returns a boolean result
  • In JavaScript, == is preferred to === and != is preferred to !==
  • All of the above

Q2. Choose a correct if-else condition:

  • Code 1
if{

}else(condition){

}
  • Code 2
if(condition){

}else(condition){

}
  • Code 3
if(condition){

}else{

}
  • Code 4
if{

}else{

}

Q3. Is the following statement correct?

Complex conditions can be created using the logical operators & (“and”), | (“or”) and ! (“not”).

  • True
  • False

Q4. Choose a correct switch statement:

  • Code 1
switch{
case value1:
  break;
case value2:
  break;
default:
}
  • Code 2
switch (expression) {
case value1:
  break;
case value2:
    break;
default:
}
  • Code 3
switch (expression) {
case value1;
  break;
case value2;
  break;
default;
}
  • Code 4
switch (expression) {
case value1:
  break:
case value2:
default:
}

Q5. Take a look at the following program:

let nb1 = Number(prompt("Enter nb1:"));
let nb2 = Number(prompt("Enter nb2:"));
let nb3 = Number(prompt("Enter nb3:"));

if (nb1 > nb2) {
  nb1 = nb3 * 2;
} else {
  nb1++;
  if (nb2 > nb3) {
    nb1 += nb3 * 3;
  } else {
    nb1 = 0;
    nb3 = nb3 * 2 + nb2;
  }
}
console.log(nb1, nb2, nb3);

Try to guess the final values of variables nb1,nb2and nb3depending on following initial values:

nb1 = 4

nb2 = 4

nb3 = 4

  • nb1 = 8
    nb2 = 4
    nb3 = 4
  • nb1 = 0
    nb2 = 4
    nb3 = 12
  • nb1 = 17
    nb2 = 4
    nb3 = 4
  • None of the above

Q6. Take a look at the following program:

let nb1 = Number(prompt("Enter nb1:"));
let nb2 = Number(prompt("Enter nb2:"));
let nb3 = Number(prompt("Enter nb3:"));

if (nb1 > nb2) {
  nb1 = nb3 * 2;
} else {
  nb1++;
  if (nb2 > nb3) {
    nb1 += nb3 * 3;
  } else {
    nb1 = 0;
    nb3 = nb3 * 2 + nb2;
  }
}
console.log(nb1, nb2, nb3);

Try to guess the final values of variables nb1,nb2and nb3depending on following initial values:

nb1 = 2

nb2 = 4

nb3 = 0

  • nb1 = 3
    nb2 = 4
    nb3 = 0
  • nb1 = 3
    nb2 = 4
    nb3 = 4
  • nb1 = 0
    nb2 = 4
    nb3 = 0
  • None of the above

Q7. Take a look at the following program:

let nb1 = Number(prompt("Enter nb1:"));
let nb2 = Number(prompt("Enter nb2:"));
let nb3 = Number(prompt("Enter nb3:"));

if (nb1 > nb2) {
  nb1 = nb3 * 2;
} else {
  nb1++;
  if (nb2 > nb3) {
    nb1 += nb3 * 3;
  } else {
    nb1 = 0;
    nb3 = nb3 * 2 + nb2;
  }
}
console.log(nb1, nb2, nb3);

Try to guess the final values of variables nb1,nb2and nb3depending on following initial values:

nb1 = 4

nb2 = 3

nb3 = 2

  • nb1 = 0
    nb2 = 3
    nb3 = 7
  • nb1 = 4
    nb2 = 3
    nb3 = 2
  • nb1 = 11
    nb2 = 3
    nb3 = 2
  • None of the above

Quiz 4: Repeat Statements

Q1. Is the following statement correct?

Loops are used to repeat a series of statements and each repetition is called an iteration.

  • True
  • False

Q2. Is the following statement correct?

When we don’t know in advance how many times loop is going to run, for loop is preferred.

  • True
  • False

Q3. Choose a correct option:

  • The variable associated with the loop condition is called the loop counter
  • Updating the counter of a for loop inside its body is a bad idea
  • All loops can be written with while
  • All of the above

Q4. Choose a correct while loop:

  • Code 1
while(){

}
  • Code 2
while(condition){

}
  • Code 3
while{

}(condition)
  • All of the above

Q5. Choose a correct for loop:

  • Code 1
for (initialization; condition; final expression){
}
  • Code 2
initialization;
for (;condition; final expression){
}
  • Code 3
for (;;){
}
  • All of the above

Q6. What the given program will print?

let number = 200; 
while (number > 100) { 
  console.log(number); 
  number--;
}

Choose the correct option:

  • Print numbers from 0 to 100
  • Print numbers from 0 to 200
  • Print numbers from 101 to 200
  • Print numbers from 200 to 101

Q7. What the given program will print?

for(let number=0; number < 10; number++) 
{
  console.log(number);
  number++;
}

Choose the correct option:

  • 0
    1
    2
    3
    4
    5
    6
    7
    8
    9
  • 1
    2
    3
    4
    5
    6
    7
    8
    9
    10
  • 0
    2
    4
    6
    8
  • 1
    3
    5
    7
    9

Quiz 5: Write Functions

Q1. Choose the correct option

  • A function is a group of if-else statements that performs a particular task
  • JavaScript functions are created using the func keyword
  • A function call triggers the execution of the function code
  • All of the above

Q2. Choose the correct option:

  • Variables declared inside a function are not just limited to the function body (in scope)
  • A function can accept zero, one or several parameters in order to work
  • Variables declared inside a function are called global variables
  • All of the above

Q3. Choose the correct option:

  • Mainly there are 2 ways to create a function in JavaScript
  • Function declaration is used to create anonymous functions (functions without a name)
  • return statement inside the function body defines the return value of the function
  • All of the above

Q4. Choose the correct format for function declaration:

  • Code 1
const myFunc = function(param1, param2, ...) {
  // Function code using param1, param2, ...
};

// Function call
myFunc(arg1, arg2, ...);
  • Code 2
const myFunc = (param1, param2, ...) => {
  // Function code using param1, param2, ...
};

// Function call
myFunc(arg1, arg2, ...);
  • Code 3
function myFunction(param1, param2, ...) {
  // Function code using param1, param2, ...
}

// Function call
myFunction(arg1, arg2, ...);
  • None of the above

Q5. Choose the correct format for anonymous function:

  • Code 1
const myFunc = function(param1, param2, ...) {
  // Function code using param1, param2, ...
};

// Function call
myFunc(arg1, arg2, ...);
  • Code 2
const myFunc = (param1, param2, ...) => {
  // Function code using param1, param2, ...
};

// Function call
myFunc(arg1, arg2, ...);
  • Code 3
function myFunction(param1, param2, ...) {
  // Function code using param1, param2, ...
}

// Function call
myFunction(arg1, arg2, ...);
  • None of the above

Q6. Choose the correct format for arrow syntax:

  • Code 1
const myFunc = function(param1, param2, ...) {
  // Function code using param1, param2, ...
};

// Function call
myFunc(arg1, arg2, ...);
  • Code 2
const myFunc = (param1, param2, ...) => {
  // Function code using param1, param2, ...
};

// Function call
myFunc(arg1, arg2, ...);
  • Code 3
function myFunction(param1, param2, ...) {
  // Function code using param1, param2, ...
}

// Function call
myFunction(arg1, arg2, ...);
  • None of the above

Q7. Choose the correct output for the following program:

function sayHello() {
  const message = "Hello!";
  return message;
}
console.log(message); // Error: the message variable is not visible here
  • Hello!
  • Compile time error
  • Runtime error
  • None of the above

Quiz 6: Create your First Object

Q1. Choose the correct option:

  • An object contains properties in the form of key-value pairs
  • The value of a property can be a piece of information (number, string, etc) or a method
  • console and Math are one of the JavaScript pre defined objects
  • All of the above

Q2. Choose the correct format of creating object-literal in JavaScript:

  • A JavaScript object literal is created by simply setting its properties within a pair of square brackets
  • Inside a method, the this keyword represents the object on which the method is called
  • semicolon ; is compulsory to write at the end of object-literal
  • All of the above

Q3. Choose the correct format of creating object-literal in JavaScript:

  • Code 1
const myObject = {
  property1: value1;
  property2: value2;
  method1(/* ... */) {
    // ...
  };
  method2(/* ... */) {
    // ...
  };
  // ...
};
  • Code 2
const myObject = {
  property1: value1,
  property2: value2,
  method1(/* ... */) {
    // ...
  },
  method2(/* ... */) {
    // ...
  }
  // ...
};
  • Code 3
const myObject = {
  property1 => value1,
  property2 => value2,
  method1(/* ... */) {
    // ...
  };
  method2(/* ... */) {
    // ...
  };
  // ...
};
  • Code 4
const myObject = {
  property1: value1
  property2: value2
  method1(/* ... */) {
    // ...
  }
  method2(/* ... */) {
    // ...
  }
  // ...
};

Q4. Choose the correct output:

const pen = {
  type: "ballpoint",
  color: "blue",
  brand: "Bic"
};

pen.price = "2.5";

console.log(`My pen costs ${pen.price}`);
  • My pen costs 2.5
  • Compile time error
  • Runtime error
  • None of the above

Q5. Choose the correct output:

const pen = {
  type: "ballpoint",
  color: "blue",
  brand: "Bic",
  price: 3
};

pen.price = 4;

console.log(`My pen costs ${pen.price}`);
  • My pen costs 3
  • My pen costs 4
  • Compile time error
  • Runtime error

Quiz 7: Store Data in Arrays

Q1. Choose the correct option:

  • size property is used to get the number of elements of the array
  • The first element of an array will be at index number 0
  • You can access a particular element by passing its index within curly braces {}
  • All of the above

Q2. Choose the correct option:

  • To iterate over an array (browsing it element by element), you can use the for in loop
  • The push() method adds an element at the beginning of the array
  • The pop() and splice() are used to remove elements from the array
  • All of the above

Q3. Choose the correct output:

const alphabets = ["A", "B", "C"];
alphabets.splice(0, 1);
console.log(alphabets[1]); 
  • A
  • B
  • C
  • None of the above

Q4. Choose the correct output:

const alphabets = ["A", "B", "C"];
alphabets.pop();
console.log(alphabets[2]); 
  • A
  • B
  • C
  • None of the above

Q5. Choose the correct output:

const alphabets = ["A", "B", "C"];
alphabets.push("D");
console.log(alphabets[0] + "," + alphabets[3]);
  • D,A
  • A,C
  • A,D
  • D,C

Q6. Choose the correct output:

const alphabets = ["A", "B", "C"];
alphabets.unshift("D");
console.log(alphabets[0] + "," + alphabets[3]);
  • D,A
  • A,C
  • A,D
  • D,C

Q7. Which of the following for loops will execute to the end of the array.

Choose the correct option:

  • Code 1
for (let i = 0; i <= myArray.length; i++) {
  // Use myArray[i] to access each array element one by one
}
  • Code 2
for (let i = 0; i < myArray.size(); i++) {
  // Use myArray[i] to access each array element one by one
}
  • Code 3
for (let i = myArray.length - 1; i >= 0; i--) {
  // Use myArray[i] to access each array element one by one
}
  • None of the above

Q8. Identify which of the following is correct for each loop?

Choose the correct option:

  • Code 1
myArray.forEach(myElement => (
  // Use myElement to access each array element one by one
));
  • Code 2
myArray.forEach(myElement => {
  // Use myElement to access each array element one by one
});
  • Code 3
myArray.for(myElement => {
  // Use myElement to access each array element one by one
});
  • None of the above

Q9. Identify which of the following is a correct for-of loop?

Choose the correct option:

  • Code 1
for (const myElement in myArray) {
  // Use myElement to access each array element one by one
}
  • Code 2
for (const myElement of myArray) {
  // Use myElement to access each array element one by one
}
  • Code 3
forEach (const myElement in myArray) {
  // Use myElement to access each array element one by one
}
  • None of the above

Quiz 8: Work with Strings

Q1. Choose the correct option:

  • String values may be compared using the === operator, which is case sensitive.
  • JavaScript strings are not immutable.
  • You may iterate over a string using either a for or a for-in loop
  • All of the above

Q2. Choose the correct option:

  • The splice() method breaks a string into subparts delimited by a separator
  • Searching for values inside a string is possible with the indexOf()startsWith(), and endsWith() methods
  • The Array.to() method can be used to turn a string into an array
  • None of the above

Q3. Choose the correct option:

  • The length property returns the number of characters of the string
  • The toLower() and toUpper() methods respectively return new converted strings to lower and upper case
  • A string may be seen as a array of characters identified by their index. The index of the first character is 1.
  • None of the above

Q4. Choose the correct output:

const name = "Berlin";
console.log(name[6]);
  • B
  • n
  • undefined
  • “”

Q5. The following code snippets produce same result:

const name = "Sarah";
for (let i = 0; i < name.length; i++) {
  console.log(name[i]);
}
const name = "Sarah";
for (const letter of name) {
  console.log(letter);
}
  • True
  • False

Q6. Choose the correct output for the following code snippet:

const alphabets = "A,B,C,D";
const result = alphabets.split(";");
console.log(result[0]);
  • A
  • B
  • A,B,C,D
  • None of the above

Q7. Choose the correct output for the following code snippet:

const alphabets = "A,B,C,D";
const result = alphabets.split("B");
console.log(result[1]);
  • ,
  • ,C,D
  • A,
  • None of the above

Quiz 9: Understand Object Oriented Programming

Q1. Choose the correct option:

  • A JavaScript class can contain methods and properties
  • Objects are created from a class with the new operator
  • JavaScript’s OOP model is not based on prototypes
  • All of the above

Q2. Choose the correct option:

  • When trying to access a property that does not exist in an object, JavaScript tries to find this property in the prototype chain of this object
  • A class is created with the class keyword, followed by curly braces.
  • Object.link() is a way to create and link JavaScript objects through prototypes.
  • All of the above

Q3. Choose the correct format to declare a class in JavaScript:

  • Code 1
class MyClass {
  constructor(param1, param2, ...) {
    this.property1: param1,
    this.property2: param2
    // ...
  }
  method1(/* ... */) {
    // ...
  }
  method2(/* ... */) {
    // ...
  }
  // ...
}
  • Code 2
class{
  constructor(param1, param2, ...) {
    this.property1 = param1;
    this.property2 = param2;
    // ...
  }
  method1(/* ... */) {
    // ...
  }
  method2(/* ... */) {
    // ...
  }
  // ...
}
  • Code 3
class MyClass {
  constructor(param1, param2, ...) {
    this.property1 = param1;
    this.property2 = param2;
    // ...
  }
  method1(/* ... */) {
    // ...
  }
  method2(/* ... */) {
    // ...
  }
  // ...
}
  • Code 4
class MyClass {
    this.property1: param1,
    this.property2: param2
    // ...
  method1(/* ... */) {
    // ...
  }
  method2(/* ... */) {
    // ...
  }
  // ...
};

Q4. Choose the correct format to declare an object:

  • Code 1
class A{}
var a = Object.create(A);
  • Code 2
var a = new class A{};
  • Code 3
class A{}
var a = new A();
  • None of the above

Quiz 10: Discover Functional Programming

Q1. Choose the correct option:

  • The state of a program is the value of its local variables at a given time
  • A goal of functional programming is to maximize state mutations (changes)
  • JavaScript functions can be passed around just like any other value
  • All of the above

Q2. Choose the correct option:

  • A function that takes another function as a parameter or returns another function is called a Lower-order function
  • A pure function depends solely on its inputs for computing its outputs and has no side effect
  • JavaScript is not a multi-paradigm language
  • All of the above

Q3. Choose the correct option:

  • The filter() method takes an array as a parameter and creates a new array with the results of calling a provided function on every element in this array
  • The map() method offers a way to test every element of an array against a provided function
  • The reduce() method applies a provided function to each array element in order to reduce it to one value
  • All of the above

Q4. Is the following statement correct?

reduce() method takes two parameters: the first is an accumulator which contains the accumulated value previously returned by the last invocation of the function and the other parameter is the array element.

  • True
  • False

Q5. Choose the correct option:

  • A pure function is independent from the program state and must not access it
  • The only way for a function without parameters to be pure is to return a constant value
  • A side effect is a change in program state or an interaction with the outside world
  • All of the above

Q6. Choose the correct option:

  • Any assignment to one of the local variables is a state change, often called a mutation
  • In order to decrease the risk of accidental state mutation, a first step is to favor let over const whenever applicable for variable declarations
  • Procedural programming means to split source code into subroutines
  • All of the above

Quiz 11: Create Interactive Web Pages

Q1. What does the <head> tag stores in HTML?

  • title
  • scripts
  • style
  • links
  • All of the above

Q2. A Hyperlink can be in the form of:

  • Image
  • Controls
  • URL’s
  • All of the above

Q3. A browser is the software you use to visit webpages and use web applications. Is this statement True or False?

  • True
  • False

Q4. What is the purpose of using JavaScript language?

  • JavaScript provides dynamic interactivity within a web page
  • JavaScript is used to modify the presentation of data
  • JavaScript is used to show the basic content of a web page
  • All of above

Q5. Which of these could be a possible CSS Selector?

  • HTML tags
  • Class
  • Scripts
  • Identifier
  • All except C

Q6. Which of the following is not an attribute of <link> tag in HTML?

  • rel
  • type
  • style
  • sizes

Q7. In CSS, a class is defined by using (.) symbol and identifier is defined by using (#) symbol. Is this statement True or False?

  • True
  • False

Q8. An HTML file is rendered by:

  • Compiler
  • Interpereter
  • Browser
  • All of above

Quiz 12: Discover the DOM

Q1. In HTML DOM, everything is stored in the form of:

  • Elements
  • Attributes
  • Nodes
  • Classes

Q2. The element <a> is the child node of which element?

  • <text>
  • <p>
  • <span>
  • <body>

Q3. The nodes cannot be further decomposed into any more elements. Is this statement True or False?

  • True
  • False

Q4. We can access any element from document variable in JavaScript, is this statement True of False?

  • True
  • False

Q5. The type of <p> tag can be determined by:

  • p.nodeType
  • document.p.nodeType
  • p.elementType
  • None of above

Q6. The children of an element are stored in a childNode property which is:

  • A class
  • An array
  • A list
  • None of above

Q7. What will this statement document.parentNode return?

  • Error
  • Null
  • Zero
  • Root

Q8. The document variable corresponds to?

  • Root
  • Null
  • <HTML>
  • All of the above

Quiz 13: Traverse the DOM

Q1. What does querySelectorAll() function returns?

  • List of Elements
  • Count
  • Class
  • Identifier
  • None of above

Q2. What does the querySelector() function returns when there is no associated element found?

  • Zero
  • Null
  • None of above

Q3. The difference between querySelectorAll() and querySelector() is that querySelector returns the last element, where as querySelectorAll() returns all the elements associated to the class or identifier. Is this statement True or False?

  • True
  • False

Q4. The attributes of the following are directly accessible as properties except:

  • id
  • class
  • href
  • value

Q5. Given this HTML code:

<h1>Favourite seasons</h1>
<p>Here's the list of my favorite seasons on Netflix</p>
<div id="fav">
    <ul class="seasons" id="favseasons">
        <li class="netflix">Peaky Blinders</li>
        <li>House of Cards</li>
        <li>Narcos</li>
        <li>Dexter</li>
    </ul>

Can you guess what will be the output of this JavaScript this statement console.log(classes[1]); on the code written above?

  • netflix
  • classes is not defined
  • None of above

Q6. When is it convenient to use the innerHTML property?

  • When we want to access a specific element
  • When we want to access the HTML of an element
  • When we want to modfiy the HTML of an element
  • Both B and C

Quiz 14: Modify page structure

Q1. appendChild() function is commonly used to add an element into the DOM structure. Is this statement True or False?

  • True
  • False

Q2. beforeend is the position in which the element is inserted at:

  • before the existing element
  • inside the existing element, before its first child
  • inside the existing element, after its last child
  • after the existing element

Q3. How many parameters are passed in the replaceChild() function?

  • 1
  • 2
  • 3
  • 4

Q4. Does updating DOM objects through JavaScript can affect the performance. Is this statement True or False?

  • True
  • False

Q5. The following methods could be used to modify the element in DOM except?

  • innerHTML()
  • createTextNode()
  • classList()
  • textContent()

Q6. How will we write a CSS property background-color in JavaScript?

  • backGroundColor
  • backgroundColor
  • BackgroundColor
  • backgroundcolor

Quiz 15: React to Events

Q1. In event-driven programming, the web page reacts to user’s actions. Is this statement True or False?

  • True
  • False

Q2. What does the addEventListener() method do?

  • It triggers an action based on an event
  • It associates an action with an event
  • It attaches an event handler to a specified element
  • None of above

Q3. What is the correct syntax to remove an Event Listener from the button named myButtonbased on an event called "hover"?

  • Code 1
buttonElement.removeEventListener("hover");
  • Code 2
myButton.removeEventListener("hover", showMessage);
  • Code 3
buttonElement.removeEventListener("hover", showMessage);
  • Code 4
myButton.removeEventListener("hover");

Q4. Scrolling a page by pressing the upward key from keyboard is an event which is a:

  • Mouse Event
  • Keyboard Event
  • Window Event
  • None of the above

Q5. What is target in an Event object?

  • The event which is called on an Element
  • The Element on which triggers the event
  • Both of the above
  • None of the above

Q6. how many types of events are there?

  • 3
  • 4
  • 5
  • 6

Q7. Which property is used to fetch the code of a key when it is pressed?

  • charInfo
  • keyInfo
  • charCode
  • keyCode

Q8. Which method() is used to retrieve the mouse click?

  • getMouseInfo()
  • getMouseClick()
  • getMouseButton()
  • None of the above

Q9. What is event propagation?

  • Event triggered on parent node get triggered on children nodes
  • Event triggered on child node get triggered on the immediate parent node
  • Event triggered on child node get triggered on the parents nodes till the root
  • Event triggered on child node get triggered on the child node only

Q10. Event triggered on child node get triggered on the child node only

  • unload
  • scroll
  • select
  • copy

Quiz 16: Manipulate forms

Q1. A ______ lets users input data through a web page

  • <form>
  • <button>
  • <input>
  • All of the above

Q2. We access the content of inputs via this property:

  • type
  • value
  • name
  • id

Q3. We access the content of inputs via this property:

  • blur
  • active
  • focus
  • None of the above

Q4. Which event gets triggered when the user modifies an input?

  • input
  • change
  • focus
  • All of the above

Q5. Regular experessions can be used to validate the data in JavaScript. Is this statement True or False?

  • True
  • False

Q6. When we submit the form, which of the following events get triggered?

  • onformSubmit
  • submit
  • validate
  • All of the above

Q7. When do we use preventDeafult() method?

  • To stop the browser’s default behavior
  • Prevent sending form data to server
  • Prevent event propagation
  • A an B
  • A and C
  • All of above

Q8. Which of the following is not the attribute of <input>

  • type
  • value
  • size
  • None of the above

Quiz 17: Animate elements

Q1. Which of the following method triggers a repeated action?

  • clearInterval()
  • setTimeOut()
  • setInterval()
  • None of the above

Q2. Which of the following method stops a repeated action?

  • setInterval()
  • clearInterval()
  • setTimeOut()
  • Number()

Q3. Which function is used to execute a function after a certain delay?

  • setInterval()
  • setTimeOut()
  • clearInterval()
  • None of the above

Q4. The requestAnimationFrame() function asks the browser to execute a function that updates the animation as soon as possible. Is this statement True or False?

  • True
  • False

Q5. You cannot create animations via CSS. Is this statement True or False?

  • True
  • False

Q6. The cancelAnimationFrame() function stops an in-progress animation that was launched with requestAnimationFrame(), is this statement True or False?

  • True
  • False

Quiz 18: Building Web Applications

Q1. Data exchanges on the Web follow a _______ paradigm.

  • client/server
  • request/response
  • push/pull
  • All of the above

Q2. The secured version of HTTP is:

  • XHTTP
  • HTTPS
  • SSL
  • None of the above

Q3. HTTP is the protocol that allows two machines to communicate with each other on the web.

  • True
  • False

Q4. Which of the following is not an HTTP method?

  • LINK
  • CONNECT
  • OPTIONs
  • PATCH

Q5. Which method is used when we want to send data to the server?

  • GET
  • POST
  • PUT
  • PUSH

Q6. The status code for success is:

  • 404
  • 100
  • 200
  • 444

Q7. AJAX supports synchronous web requests. Is this statement True or False?

  • True
  • False

Q8. Cross-domain AJAX requests are not possible if the server has been configured to accept them by setting on cross-origin resource sharing. Is this statement True or False?

  • True
  • False

Q9. Which data representing format is better:

  • XML
  • JSON
  • YAML
  • SOAP

Q10. Status codes in the form of 5xx are:

  • Client Errors
  • Redirection
  • Server Errors
  • Success

Quiz 19: Query a Web Server

Q1. HTTP requests sent to a web server need to be synchronous to prevent blocking the client application while waiting for the server’s response.

  • True
  • False

Q2. The XMLHttpRequest() method is better than fetch() method as the go-to way of creating an asynchronous request.

  • True
  • False

Q3. Which of the following could not be a possible state for promise?

  • fulfilled
  • rejected
  • settled
  • All of above

Q4. When is catch() method called in JavaScript?

  • When the program throws an exception
  • When there is a run time error in the code
  • When a promises is rejected
  • All of the above

Q5. The difference between XMLHttpRequest and fetch() is that XMLHttpRequest uses promises. Is this statement True or False?

  • True
  • False

Q6. Which of the following method is used to convert JSON data into valuable objects?

  • fetch()
  • parse()
  • then()
  • stringify()

Quiz 20: Use Web APIs

Q1. What do we use APIs for?

  • To allow communication between two applications
  • To integrate an external resource with own application
  • To share the status among two applications sharing data
  • Both A and B
  • All of the above

Q2. Document Object Model itself is an API. Is this statement True or False?

  • True
  • False

Q3. Web Services do not provide an interface for web applications. Is this statement True or False?

  • True
  • False

Q4. Which of the following real-world example demonstrates best the use of web API?

  • Share a CNN article on Facebook via CNN website
  • Hit like button on Facebook
  • Watching a video on YouTube
  • Using Goolge Maps for navigation
  • A and B
  • A and D
  • All of the above

Q5. The data recieved via API is in the what form?

  • XML
  • YAML
  • JSON
  • BSON

Q6. The access key is used to authorize a user. Is this statement True or False?

  • True
  • False

Quiz 21: Send Data to a Web Server

Q1. Which object is used to send form data to the server?

  • Response
  • JSONData
  • FormData
  • POST

Q2. Which function is used to fill the FormData object with values?

  • fill()
  • addElement()
  • append()
  • All of the above

Q3. When the information expected by the server is more structured, which data format is more convenient to use?

  • XML
  • BSON
  • YAML
  • JSON

Q4. The second parameter of the fetch() call sets the suitable HTTP method to send the response back to server. Is this statement True or False?

  • True
  • False

Q5. By default, the form submits the data asynchronously. Is this statement True or False?

  • True
  • False

Quiz 22: Discover Node.js

Q1. Node.js focuses more on:

  • Cohesiveness
  • Modularity
  • Coupleness
  • None of above

Q2. Node.js offers which method to laod a module?

  • loadModule()
  • runModule()
  • require()
  • module()

Q3. Inside a module, which object is used to export an element?

  • module.export
  • module.export.element
  • module.exports
  • None of the above

Q4. We can not reassign module.export to export only a specific element, is it correct?

  • True
  • False

Q5. Which file is the set the default entry point of a Node package?

  • package.json
  • default.json
  • index.json
  • None of the above

Q6. A semantic versioning format is a ______ digit format used to define package versions.

  • 2
  • 3
  • 4
  • 5

Q7. In semantic versioning format, the string is in the form:

  • MINOR.MAJOR.PATCH
  • MINOR.PATCH.MAJOR
  • PATCH.MINOR.MAJOR
  • MAJOR.MINOR.PATCH

Q8. Once installed through npm, packages defined as dependencies are stored in the

  • node_modules/packages
  • node_modules/subfolder
  • node_module/dependencies
  • node_module/subfolder/packages

Q9. The packages containing only executable files or no entry point can be loaded as modules, is this statement True or False?

  • True
  • False

Quiz 23: Create a Web Server

Q1. The Node.js platform is not quite suited for creating web servers in JavaScript. Is this statement True or False?

  • True
  • False

Q2. A ______ provides a standard way to design and structure an application

  • Web Server
  • Web Service
  • Framework
  • Application Programming Interface

Q3. The entry point associated to URLs defined by an Express app is called:

  • link
  • route
  • path
  • shell

Q4. What does the term middleware mean?

  • a file which save request/response data
  • a link between server and client
  • A server which offers communication between two devices
  • a code that runs during request/response cycle

Q5. Which package is used to manage the JSON data or an incoming form?

  • multer
  • body-parser
  • yarn
  • A and B
  • All of above

Q6. JavaScript can only be used on the server side of a web application. Is this statement True or False?

  • True
  • False
Conclusion:

I hope this Complete JavaScript Course: Build a Real World App from Scratch Educative Quiz Answers would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.

This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.

Keep Learning!

More Coding Solutions >>

LeetCode Solutions

Hacker Rank Solutions

CodeChef Solutions

Leave a Reply

Your email address will not be published.