Questions
Questions
b.
b.
Returns blue, green or red, depending on the parameter "color"
It returns 1 if val is truthful, otherwise 2
c.
c.
Always returns red
It returns val
Feedback
Feedback
Your answer is correct.
Your answer is correct.
The correct answer is: Always returns red
The correct answer is: It returns 1 if val is truthful, otherwise 2
Question 3
Question 2
Correct
Correct Mark 1.00 out of 1.00
Mark 2.00 out of 2.00
Flag question
Flag question
Question text
Question text
function whatDoesItDo() {
function whatDoesItDo(color) {
return document.querySelectorAll('*').length;
if (color !== 'blue' || color !== 'green') {
color = 'red'; }
} Select one:
return color;
a. document.body.innerHTML("Hello World");
Initializes an empty XHTML namespace
d.
b. document.body.innerText = "Hello World";
Throws an error
Feedback
Your answer is correct.
c.
The correct answers are: document.body.innerHTML = "Hello
Returns the number of elements on the page
World";, document.body.innerText = "Hello World";
Feedback
Your answer is correct. Question 5
Correct
The correct answer is: Returns the number of elements on the Mark 1.00 out of 1.00
page
Flag question
Question 4
Correct Question text
Mark 1.00 out of 1.00 What method do we use to create an event listener?
Question text a.
Which of these lines of code would replace the content of a element.makeEventListener()
webpage with "Hello World"?
a.
c.
DOMFinished
var button = document.createElement('button');
b.
d.
DOMReady
var button = document.createElement('');
c. Feedback
DOMContentLoaded Your answer is correct.
The correct answer is: var button =
d. document.createElement('button');
DocumentReady
Question 8
Feedback Correct
Your answer is correct. Mark 1.00 out of 1.00
b.
document.getElementsByClass()
c.
document.querySelectorAll()
d.
document.querySelector()
Feedback
Your answer is correct.
The correct answer is: document.querySelector()
Flag question
What is the function of the tag below?
<title> This tag </title>
Question text
In CSS, how would you select all the <p> tags on a page?
Select one:
Select one:
a.
a. #p { }
show the server how to title the website
b.
.p { }
b.
show the server how to index the website
c.
<p> { }
c.
store meta information about the title
d.
p{}
d.
Feedback
stores the title of the website for the browser and search engine
Your answer is correct.
results
The correct answer is: p { }
Feedback
Your answer is correct. Question 3
Correct
The correct answer is:
Mark 1.00 out of 1.00
stores the title of the website for the browser and search engine
results Flag question
b. b.
relative warning { }
c. c.
static p{}
d. d.
absolute .warning { }
Feedback Feedback
Your answer is correct. Your answer is correct.
The correct answer is: static The correct answer is: .warning { }
Question 4 Question 5
Correct Correct
Mark 1.00 out of 1.00 Mark 1.00 out of 1.00
b.
Select one:
body
c.
padding:10px 15px 5px 10px;
c.
title
d.
padding:15px 5px 10px 10px;
d.
head Feedback
Your answer is correct.
Feedback
Your answer is correct. The correct answer is: padding:10px 5px 15px 10px;
The correct answer is: body Question 7
Incorrect
Question 6 Mark 0.00 out of 1.00
Correct
Mark 1.00 out of 1.00
Flag question
Select one:
b.
a. margin: auto 0;
padding:10px 5px 15px 10px;
c.
b. margin: center;
padding:10px 5px 10px 15px;
Feedback
Your answer is correct.
Question 2 Question 3
Partially correct Correct
Mark 0.50 out of 1.00 Mark 1.00 out of 1.00
Question text
e.
The following function can be rewritten using Arrow functions as
We don't have static methods in ES5 (prototype based) classes,
follows:
because there is no "static" keyword
Feedback
Your answer is correct. const getFullName = function(firstName, lastName) {
The correct answers are: They don't need a class instance to use return firstName + ' ' + lastName;
them, "static" keyword marks static methods in ES6 Classes }
Question 4 Select one:
Incorrect
Mark 0.00 out of 1.00
a.
const fullName = function(firstName, lastName) => firstName + '
Flag question
' + lastName;
Question text
Will the following code throw an error in browser console? b.
const fullName = (firstName, lastName) => firstName + ' ' +
lastName;
console.log(typeof x);
Select one: c.
True const fullName = (firstName, lastName)
False
=> firstName + ' ' + lastName;
Feedback
It will not throw an error , but it will print: undefined
d.
The correct answer is 'False'.
const fullName = (firstName, lastName) => { firstName + ' ' +
lastName; } e.
"class" keyword is a sugar syntax for "prototype" based classes
Feedback
Your answer is correct. Feedback
Your answer is partially correct.
The correct answer is: const fullName = (firstName, lastName) =>
firstName + ' ' + lastName; You have correctly selected 1.
The correct answers are: "Prototype" - it's one way of declaring
Question 6 classes in JS, Classes are just functions named with uppercase,
Partially correct
"class" keyword is a sugar syntax for "prototype" based classes
Mark 0.33 out of 1.00
Question 7
Flag question
Correct
Mark 1.00 out of 1.00
Question text
Check what you find true regarding Classes in Javascript: Flag question
Select one or more: Question text
Check the statements that you consider true for "const" keyword:
a.
the following code works just fine because of "hoisting": Select one or more:
const user = new User();
a.
class User {}; the value of a constant can not be reassigned
b. b.
We can create a class using "new" keyword a constant can not be redeclared
c. c.
"Prototype" - it's one way of declaring classes in JS variable hoisting is not applied to constants
d. d.
Classes are just functions named with uppercase const user = {
name: 'John',
age:22 console.log(x);
} Select one:
user.age = 30; True
False
The above code it's not throwing an error, and it works as
expected.
Feedback
The correct answer is 'True'.
e. Question 9
they are visible only in the current block scope Correct
Mark 1.00 out of 1.00
Feedback
Your answer is correct. Flag question
The correct answers are: they are visible only in the current block Question text
scope, the value of a constant can not be reassigned, a constant Check the statements that you consider true about declaring a
can not be redeclared, variable hoisting is not applied to variable using "let" keyword:
constants, const user = {
Select one or more:
name: 'John',
age:22
a.
}
the variable declared with "let" will be visible everywhere in current
user.age = 30;
function
The above code it's not throwing an error, and it works as
expected.
b.
Question 8 "let" works exactly the same as "var", but it's the ES6 word for it
Correct
Mark 1.00 out of 1.00
c.
Flag question the value of the variable can be changed after it was declared
Question text
Will the following code throw an error in browser console? d.
the variable declared with "let" will be visible only in current block Question text
The <title> element must be located inside
e.
It is not available in ES5 Select one:
Feedback
<head> element
Your answer is correct.
The correct answers are: It is not available in ES5, the variable
declared with "let" will be visible only in current block, the value of
the variable can be changed after it was declared it can be put in a simple div, section, article
Question 10
Correct <body> element
Mark 1.00 out of 1.00
Feedback
Flag question Your answer is correct.
Question text The correct answer is: <head> element
Arrow functions share the same Blank 1 as their surrounding code Question 2
Correct
Feedback Mark 0.20 out of 0.20
Your answer is correct.
Flag question
The correct answer is:
Arrow functions share the same [this] as their surrounding code Question text
What is an object in JavaScript ?
Select one:
Select one:
document.getId(“geek”)=”I am a Geek”;
Is equivalent to:
document.getElementById(“geek”).innerHTML=”I am a Geek”;
document.getElement(“geek”).innerHTML=”I am a Geek”;
document.getElementById(“geek”).innerHTML=I am a Geek;
Feedback
Your answer is correct.
The correct answer JavaScript Object Notation is a syntax for serializing objects, arrays,
is: document.getElementById(“geek”).innerHTML=”I am a Geek”; numbers, strings, boolean and null, based on JavaScript object
syntax.
Question 5
Correct Select one:
Mark 0.10 out of 0.10 True
False
Flag question
Feedback
Question text The correct answer is 'True'.
How can you create a new Git repository in a "some_name"
directory ? Question 7
Correct
Select one: Mark 0.80 out of 0.80
Question text
Given the code below:
git create some_name
Question 6
Correct
Mark 0.20 out of 0.20
Flag question
Question text
"One of the promises failed with the following reason" Uncaught
(in promise) {resolvedAfterNSeconds: 0}
Feedback
Your answer is correct.
The correct answer is: “All the promises are resolved” and the
values array of results [{resolvedAfterNSeconds: 1},
{resolvedAfterNSeconds: 4}, {resolvedAfterNSeconds: 2}]
Question 8
Correct
Mark 0.40 out of 0.40
Flag question
Question text
Given the code:
Select one:
“All the promises are resolved” and the values array of results
[{resolvedAfterNSeconds: 0}, {resolvedAfterNSeconds: 4},
{resolvedAfterNSeconds: 2}]
The value of this is:
“All the promises are resolved” and the values array of results Select one:
[{resolvedAfterNSeconds: 1}, {resolvedAfterNSeconds: 4},
The object created from this object
{resolvedAfterNSeconds: 2}]
myObject
the execution of the code will result in an error
Question 10
document Incorrect
Mark 0.00 out of 0.20
Question 9
Correct
Mark 0.20 out of 0.20
Flag question
Question text
What is the correct CSS syntax for making all the <span> elements
bold ?
Question text
"class" keyword is syntax sugar for "prototype" based classes
What does the “this” keyword refer to in a function of a class?
Flag question
input.submit{ ... }
Question text
input.type=submit{ ... }
input[type=submit]{ ... }
Question 15
“Result: ” instantly and “Result: DONE” after 100 miliseconds
Correct
Mark 0.30 out of 0.30
Result: DONE after 100 miliseconds
Mark 0.20 out of 0.20
the execution of the code will result in an error
Flag question
Question 17 123
Correct
Mark 0.10 out of 0.10
15
Flag question
23
Question text
How to pass "some changes" commit message to your git
commit ? 6
Question 19
git commit -m “some changes”
Correct
Mark 0.50 out of 0.50
git commit “some changes”
Flag question
Feedback
Your answer is correct. Question text
Given the code:
The correct answer is: git commit -m “some changes”
Question 18
Correct
var games=[“Game1”, “Game2”, “Game3”]
Question 21
Calling functionA with two parameters will result in an error Incorrect
Mark 0.00 out of 0.80
Calling functionB with no parameters will return undefined
Flag question
Feedback
Your answer is correct. Question text
Question 20
Correct
Mark 0.20 out of 0.20
Flag question
Question text
How to initialize an array in JavaScript?
Select one:
var games={“Game1”, “Game2”, “Game3”}
“Result: undefined” will be printed, because x is undefined 2
Flag question
cookies
Question text
What is the name of the property that allows you to add
session storage
properties and methods to an object?
Flag question
<input type=”checkbox” />
Feedback Question text
Your answer is correct. Can a JavaScript constructor return a primitive value (e.g. a number
or a string)?
The correct answer is: <input type=”radio” />
Select one:
Question 27
Correct Yes
Mark 0.30 out of 0.30
Question text
How can we set a new cookie in JavaScript ? No
Question text
Only in Constructor How are the objects passed in JavaScript?
Feedback Select one:
Your answer is incorrect.
The correct answer is: No both by value and by reference
Question 29
by value
Correct
Mark 0.20 out of 0.20
by reference
Flag question
of promises.
Flag question
Select one:
Question text
True
Which operator is used to assign a value to a variable?
False
Feedback Select one:
The correct answer is 'True'.
*
Question 33
Correct
.
Mark 0.20 out of 0.20
Flag question +
Question text
How can you send your local changes to the remote repository =
(master branch) ?
==
Select one:
Feedback
git pull origin master Your answer is correct.
The correct answer is: =
git commit origin master
Question 2 Feedback
Correct
Your answer is correct.
Mark 1.00 out of 1.00
The correct answer is: 1 4 3 2
Flag question
Question 3
Question text Correct
In what order will the numbers 1-4 be logged to the console Mark 1.00 out of 1.00
when the code below is executed?
Flag question
Question text
(function() {
Choose the correct statements from the following, in the
console.log(1);
context of client-server architecture
setTimeout(function(){console.log(2)}, 1000);
setTimeout(function(){console.log(3)}, 0); Select one or more:
console.log(4);
})(); a.
The server has direct access to the DOM
Select one:
a. b.
1342 The server is able to make requests to the client
c. DOM object
Several clients can connect to the same server
d.
d. Window object
One client can make requests to several servers
Feedback
Feedback Your answer is correct.
Your answer is correct.
The correct answer is: Window object
The correct answers are: Several clients can connect to the same
Question 5
server, One client can make requests to several servers
Correct
Mark 0.50 out of 0.50
Question 4
Correct
Mark 1.00 out of 1.00 Flag question
Question text
Flag question
Which of the following CSS properties DOES NOT influence
Question text the box model?
The localStorage and sessionStorage belongs to
a.
Select one: outline
a.
b.
Hash object
border
b.
c.
Element object
padding
c.
d.
content The correct answer is: #object h2::first-letter
Question 7
e. Incorrect
margin Mark 0.00 out of 1.00
Feedback
Flag question
Your answer is correct.
Question text
The correct answer is: outline
Consider the following code snippet:
Question 6
Correct
Mark 1.00 out of 1.00
for (var i = 0; i < 5; i++) {
Flag question
var btn = document.createElement('button');
btn.appendChild(document.createTextNode('Button ' + i));
Question text btn.addEventListener('click', function(){ console.log(i); });
Which of the following two selectors has a higher CSS document.body.appendChild(btn);
specificity? }
What will be displayed after clicking on ‘Button 3’
a. a.
body .item div h2::first-letter:hover 4
b. b.
#object h2::first-letter 2
Feedback
Your answer is correct. c.
3
Your answer is correct.
d.
The correct answers
5
are: document.getElementById(“myId”);, document.querySelector(“
Feedback #myId”);
Your answer is incorrect.
Question 9
The correct answer is: 5 Correct
Mark 0.50 out of 0.50
Question 8
Correct Flag question
Mark 1.00 out of 1.00
Question text
Flag question What will be displayed in the console after running the
Question text following snippet of code:
Which of the following statements will find an element by its var global = "global";
‘id’ attribute
function test() {
Select one or more:
if ( !global ) {
a. var global = "local";
document.querySelector(“#myId”); }
console.log( global );
b.
}
document.getElementById(“myId”);
test();
c.
document.querySelectorAll(“.myId”);
Select one:
d. a.
document.findElementById(“myId”); global
Feedback
b. A Class is a template/a blueprint that it’s used to create multiple
local objects with the same attributes and methods
Feedback Feedback
Your answer is correct. Your answer is correct.
The correct answer is: local The correct answers are: A Class is a template/a blueprint that it’s
used to create multiple objects with the same attributes and
Question 10
methods, “New” keyword followed by constructor function call will
Correct
Mark 1.00 out of 1.00
create an “instance” of that class, “Constructor function” is
mandatory when defining a Class
Flag question
Question 11
Question text Partially correct
Mark 0.67 out of 1.00
Check what you find true about “Class”(prototype based -
ES5) and “Instance” key words
Flag question
Select one or more:
Question text
Check what you find true about Static methods:
a.
An Instance is a mandatory attribute that we need to set on Select one or more:
“prototype” when defining a Class
a.
b. Can not be invoked on a class instance
“Constructor function” is mandatory when defining a Class
b.
c. Can not be invoked without instantiating the class
“New” keyword followed by constructor function call will create an
“instance” of that class c.
Can be invoked directly on a class name, without instantiating the
d. class
d.
Are used to run utilitary code that it’s not using an instance
attributes
Feedback
Your answer is partially correct.
You have correctly selected 2.
The correct answers are: Can be invoked directly on a class name,
without instantiating the class, Are used to run utilitary code that
it’s not using an instance attributes, Can not be invoked on a class
instance