Organizer: Cisco, Networking Academy.
About the Course
- Free Online Course on JavaScript Essentials Certificate
- Duration: 40 Hours
- Level: Beginner
- Learning: Self-paced
- Skills You Will Learn: Type Casting, Debugging, Control Flow, Errors, Comments, Recursion, Functions, Exceptions, Data Types, Loops, Variables, User Interaction, Conditional Execution, Operators.
- The exam consists of 30 questions and 70% is required to pass and achieve your Cisco verified Credly badge.
- You have unlimited attempts to pass the exam.
- You have no time limit per attempt to pass the exam.
- Achievements: Certificate & Badges you can earn in this course.
Apply Link
100% Correct Answers Available Here
Question 1- Entering bask in the address bar of your browser will:
generate and load a minimal blank HTML page into the current tab.
generate a page with information about the browser’s status.
clear all inputs on the current page.
open a tab with information about your browser.
Answer: generate and load a minimal blank HTML page into the current tab.
Question 2- Analyze the following code:
2
let id “100”;
{
3 let id = 200;
4 id=id + 1;
5 console.log(id);
6 }
What will appear to the console as a result?
101
1001
201
200
Answer. 201
Question 3- Select a set of data types, containing only complex types:
Array, Object
Array, Object, String
Object, String
Boolean, Number, Bigint
Answer: Array, Object
Question 4- We can replace the declaration Let-3 with:
1et 0.333
1etxx 0.0003
1et x = 0.003
1et x 3000
Answer. 1et x = 0.003
Question 5- Using the string interpolation technique, we can create the string:
1 “I do not like travelling by plane”
and store it in the msg variable using the command:
let means “plane”;
let msg = “I do not like travelling by $( means)”}
let means “plane”;
let mag I do not like travelling by means )’;
let ans “plane”;
let msg I do not like travelling by $(means)”;
let mea “plane”
let msg = “I do not like travelling by (means)
Answer. let means = “plane”; let msg = \I do not like travelling by ${means};.
Question 6- We declare a vse object, with two fields:
1 and year
let movie {
title: “Life”, year: 1999
To change the value of the title field to “Matrix” we need to perform:
movie [title] “Matrix”
title->movie “Matrix”
movie(title) = “Matrix”)
movie.title “Matrix”
Answer. movie.title “Matrix”
Question 7- We have declared an array of animals let animals = [“dog”, “cat”, “hamster”];. Then we call the method animals.pop();. As a result, the animals array will look like this:
[“dog”, “cat”]
[“cat”, “hamster”]
[“hamster”]
[“dog”, “cat”, “hamster”]
Answer: [“canary”, “dog”, “rat”, “hamster”]
Question 8- A JavaScript code includes the sensate.log(“http://somethingnew.org command. Its execution will
display the following message on the console: http://omething.g
send a log with information about the currently executed script to the indicated address http://somethingNew.org
cause the page http://somethingNew.org to be loaded into the browser.
display on the console information about the progress of the http://somethingNew.org page loaading
Answer. display the following message on the console: http://omething.org.
Question 9- Analyze the code snippet:
1 let winter = [“December”, “January”, “February”); let index winter.indexOf(“February”);
What value will the index variable have?
“February
3
1
2
Answer. 2
Question 10- In the daysOfWeek variable, we place an array with the names of the days of the week. To reverse the order of the array elements, we should call:
reverse daysOfWeek;
daysOfWeek.invert();
invert(daysOfWeek);
daysOfWeek.reverse();
Answer. daysOfWeek.reverse()
Question 11- Review the following code:
let msg1 = ‘hello’;
let msg2 = msg1.slice(-1);
console.log(msg2 ? msg2 : msg2 + msg1);
What will appear on the console as a result?
o
ohello
hello
h
Answer. o
Question 12- Analyze the following code
What value will the test variable have if, after running the code, we immediately press the OK button on the newly created dialog?
true
OK
code
Run
Answer. Code
Question 13- Analyze the following code:
let x = false || true;
let y = “true” && “false”;
let z = false && true;
console.log(${x} ${y} ${z});
What will appear in the console as a result of its execution?
false true true
false false false
false false true
true false false
Answer. true false false
Question 14- Analyze the following code:
let a = true && 20;
let b = 0 || 20
let c = 0 && 20;
console.log(${a} ${b} ${c});
What will appear in the console as a result of its execution?
true 20 0
1 1 0
true true false
20 20 0
Answer. 20 20 0
Question. 15 Examine the following code:
let a = 20 + “10”;
let b = 20 + +”10″;
let c = 20 + -“10” + “10”;
let d = “10” – “10” + “100”;
let e = “A” – “B” + 0xA;
console.log(${a}, ${b}, ${c}, ${d}, ${e});
What will appear on the console as a result?
30, 30, 20, 100, 2
30, 31, 39, 100, NaN
2010, 2010, 20-1010, 0100, NaN
2010, 30, 1010, 0100, NaN
Answer. 2010, 30, 1010, 0100, NaN
Question 16- Which of the following loop instructions checks the loop continuation condition only after the iteration has been completed?
for … in
while
for
do … while
Answer. do…while
Question 17- The following function using a function expression has been defined:
let sum = function (a, b) {
return (a + b);
}
What could the definition of the corresponding arrow function look like?
let sum = function (a, b) => {
return (a + b); }
let sum = (a, b) => a + b;
let sum = (a, b) => { a + b; };
let sum = (a, b)– > a + b;
Answer. let sum = (a, b) => a + b;
Question 18- The temp array contains air temperature data measured over a period of time. You want to display the minimal temperature using the following code:
temp.forEach(e => min = min > e ? e : min);
console.log(min);
What should the declaration of the min variable look like?
let min;
It’s not necessary, as it will be declared automatically on first use.
let min = temp[0];
let min = 0;
Answer. let min = temp[0];
Question 19- Examine the following code:
let x = [10, 20, 30, 40];
let y = [50, 60];
x.reverse().push(y);
console.log(x.length);
What will appear on the console as a result?
6
4
5
2
Answer. 5
Question 20- Analyze the following code:
for(let a=1; a<10; a+=2) {
console.log(a);
};
Which statement can replace the for from the example?
let counter = 1;
while (counter++ < 10) console.log(counter++);
let counter = 0;
while (counter < 9) console.log(counter++);
let counter = 0;
while (counter++ < 10) console.log(counter++);
let counter = 0;
while (counter < 10) console
Answer. javascriptlet counter = 1;
while (counter++ < 10) console.log
Question 21- Analyze the following code:
let colors = [‘red’, ‘green’, ‘blue’];
for (let c of colors) console.log(c);
What will appear on the console as a result?
[‘red’, ‘green’, ‘blue’]
red
green
blue
0
1
2
3
Answer. red
green
blue
Questiin 22- Analyze the following code:
let route = {distance: 131, elevation: 1.4};
for (let k in route) console.log(k);
What will appear on the console as a result?
131
1.4
distance
distance
elevation
2
Answer. distance
elevation
Question 23- Examine the following code:
let a = (n) => {
return n > 2 ? n * a(n – 1) : 2
}
console.log(a(6));
What will appear on the console as a result?
120
720
6
4
Answer. 720
Question 24- Examine the following code:
let x = mult(2)(10);
console.log(x); // -> 20
What should the mult function declaration look like if the execution of this code results in a value of 20 in the console?
let mult = function (a) {
return function (b) {
return a * b;
}
}
There is an error in the code and it is not possible to declare such a function correctly.
let mult = function (a, b) {
return a * b;
}
let mult = function (a, b) {
return b ? mult(b) : mult(a);
}
Answer. let mult = function (a) {
return function (b) {
return a * b;
Question 25- Analyze the code snippet:
let counter = 0;
let userName = “John”;
After declaring the counter variable, we want to add a short comment with information about what the variable is used for. To do this, we modify the line with the declaration to the form:
// let counter = 0; user visit counter
let counter = 0; // user visit counter
let counter = 0; ;;user visit counter
let counter = 0; /* user visit counter
Answer. let counter = 0; // user visit counter
Question 26- Examine the following code:
x = [40, 10, 30, 20, 50];
x.sort(cmp);
How should the function cmp be declared if, after the code execution, the elements of the array x are sorted in ascending order?
let cmp = (a, b) => b < a; let cmp = (a, b) => a – b;
let cmp = (a, b) => b > a;
let cmp = (a, b) => b – a;
Answer. let cmp = (a, b) => b – a;
Question 27- Analyze the following code, which is missing one line:
let counter = 2;
let interval = setInterval(() => {
console.log(counter);
// Insert missing line here.
}, 1000);
What should the missing line look like if the execution of this code results in the console displaying the values 2, 1, and 0 in sequence?
if (counter– >= 0) clearInterval(interval);
if (counter– <= 0) clearInterval(interval); while (counter– >= 0) clearInterval(interval);
clearInterval(interval);
Answer. if (counter– == 0) clearInterval(interval);
Question 28- Analyze the following code:
function execute(todo, a, b) {
return todo(a, b);
}
console.log(execute(power, 3, 2));
Before declaring the function, we should add one more line of code. Which one, if the execution of the completed code will result in the console displaying the value 9?
let power = () => a ** b;
let power = 9;
let power = (x,y) => x * y;
let power = (x, y) => x ** y;
Answer. let power = (x, y) => x ** y;
Question 29. Analyze the following code:
const a = “hello”;
console.log(a.toUpperCase());
}
} catch (error) {
console.log(a)
} finally {
console.log(a);
}
What will happen as a result of its execution?
The following words will appear in the console on subsequent lines: HELLO, hello, and hello.
The following words will appear in the console on subsequent lines: HELLO and hello.
The following words will appear in the console on subsequent lines: hello and hello.
The following word will appear in the console: HELLO.
Answer. The following words will appear in the console on subsequent lines: HELLO and hello.
Question 30- Placing a debugger; statement in the program code will:
stop the program without the ability to continue, as long as the execution environment supports “debugging functionality”.
pause the program with the ability to continue, as long as the execution environment supports “debugging functionality”.
put the interpreter into report mode, which will cause the console to print out all sequentially executed commands.
cause the console to display the completion status of the statement preceding the debugger.
Answer. pause the program with the ability to continue, as long as the execution environment supports “debugging functionality”.