100% found this document useful (1 vote)
318 views

JSE1 - Final Test

Test final de Python

Uploaded by

josegmay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
318 views

JSE1 - Final Test

Test final de Python

Uploaded by

josegmay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

JSE1 - Final Test

Centro público integrado de formación profesional


Nuevo (desglose IES Campanillas)

JSE1
Final Test

José García JavaScript - JSE-40-01


JSE1 - Final Test

Índice
CONGRATULATIONS! .................................................................................................................................................................................3
YOU HAVE COMPLETED JAVASCRIPT ESSENTIALS 1 (JSE) .................................................................................................................................. 3
JSE1 FINAL TEST ..........................................................................................................................................................................................5

José García 2 JavaScript - JSE-40-01


JSE1 - Final Test
Congratulations!

You have completed JavaScript Essentials 1 (JSE)


Well done! You've reached the end of the JavaScript Essentials 1 (JSE) course, and completed a major
milestone in your JavaScript programming education.

You are now prepared to take the final challenge, the Mock Test, which will help you review the most important
information you've read and test the skills and knowledge you've gained throughout the course.

Having completed the course, you're also prepared to attempt the qualification JSE − Certified JavaScript
Entry-Level Programmer certification exam, which is an interim step to the JSA: Certified Associate
JavaScript Programmer certification, as well as the starting point to launching a career in software development,
JavaScript programming, and related technologies.

Ready?

José García 3 JavaScript - JSE-40-01


JSE1 - Final Test

José García 4 JavaScript - JSE-40-01


JSE1 - Final Test
JSE1 Final Test
Placing a debugger; statement in the program code will:
a. cause the console to display the completion status of the statement preceding the debugger.
b. put the interpreter into report mode, which will cause the console to print out all sequentially executed
commands.
c. pause the program with the ability to continue, as long as the execution environment supports "debugging
funcionality"
d. stop the program without the ability to continue, as long as the execution environment supports
"debugging funcionality"

We have declared an array of animals: let animals ["canary", "dog", "cat"]:. Then we call the
method animals.push("hamster"); .As a result, the animals array will look like this:
a. ["hamster", "canary", "dog", "cat"]
b. [ "canary", "dog", "cat", "hamster"]
c. [ "canary", "dog", "cat"]
d. ["hamster"]

Analyze the following code:


let test = prompt ("Run", "code")
What value will the test variable have if, after running the code, we immediately press the OK button on
the newly created dialog?
a. "code"
b. "Run"
c. “OK”
d. True

Which of the following loop instructions checks the loop continuation condition only after the iteration
has been completed?
a. do … while
b. while
c. for … in
d. for

We define a function using a function expression:


let sum = function (a, b) {
return (a + b);
}
What could the definition of the corresponding arrow function look like?
a. let sum = (a, b)-- > a + b;
b. let sum = (a, b) => { a + b; };
c. let sum = function (a, b)
=>
{
return (a + b);
}
d. let sum = (a, 0) => a + b;

José García 5 JavaScript - JSE-40-01


JSE1 - Final Test
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?
a. 4
b. 2
c. 6
d. 5

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?
a. 10 1 2
b. 3
c. red green blue
d. ['red', 'green', 'blue']

Review the following code:


let msgl = "hello";
let msg2 = msgl.slice(-1):
console.loq(msq2 ? msq2 : msq2 + msq1);
What will appear on the console as a result?
a. Hello
b. o
c. h
d. ohello

Entering about:blank in the address bar of your browser will:


a. generate and load a minimal blank HTML page into the current tab
b. clear all inputs on the current page.
c. open a tab with information about your browser.
d. generate a page with information about the browser's status

Analyze the following code:


let x = false II true;
let y ="true" && ''false"
let z = false && true;
console.log(`${x} ${x} ${x}`);
What will appear in the console as a result of its execution?
a. false true true
b. true false false
c. false false false
d. false false true

José García 6 JavaScript - JSE-40-01


JSE1 - Final Test
Analyze the following code:
let id = "100";
{
let id = 200;
id = id + 1:
console.loq(id);
}
What will appear to the console as a result?
a. 200
b. 1001
c. 101
d. 201

The JavaScript code includes the console.log ("http://somethingNew.org"); command. Its execution will:
a. cause the page http://test.org to be loaded into the browser.
b. display on the console information about the progress of the http://somethingNew.org page loading.
c. display the following message on the console: "http://somethingNew.org".
d. send a log with information about the currently executed script to the indicated address
http://somethingNew.org.

We can replace the declaration let x = 3e-3; with:


a. let x = 0.333:
b. let x = 0.0003;
c. let x = 0.003;
d. let x = 3000;

Using the string interpolation technique, we can create the string "I do not like travelling by
plane" and store it in the msg variable using the command:
a. let means = "plane";
let msg = "I do not like travelling by ${ means }";
b. let means = "plane";
let msg = ' I do not like travelling by $(means} ';
c. let means = "plane";
let msg = " I do not like travelling by \{ means \}";
d. let means = "plane";
let msg = ' I do not like travelling by {means} ';

Examine the following code:


let a = (n) => {
return n > 2 ? n * a(n -1) : 2
}
a(6);
What will appear on the console as a result?
a. 6
b. 4
c. 720
d. 120

José García 7 JavaScript - JSE-40-01


JSE1 - Final Test
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?
a. let mult = function (a, b) {
return b ? mult (b) : mult(a);
}
b. let mult = function (a, b) {
return a * b;
}
c. There is an error in the code and it is not possible to declare such a
function correctly.
d. let mult = function (a) {
return function (b) {
return a * b;
}
}

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:
a. days0fWeek. reverse();
b. daysOfWeek.order(-1):
c. days0fWeek = reverse(davsOfWeek);
d. daysOfWeek.invert();

Examine the following code:


x = [40, 10, 30, 20, 50];
x.sort(cmp);
How should the function emp be declared if, after the code execution, the elements of the array × are
sorted in ascending order?
a. let cmp = (a, b) => b > a;
b. let cmp = (a, b) => a - b;
c. let cmp = (a, b) => b < a;
d. let cmp = (a, b) => b - a;

The temp array contains air temperature data measured over a period of time. We want to display the
minimal temperature, and to do so we write the following code:
temp.forEach(e => min = min › e ? e : min);
console.log(min);
In the code, we use the variable sum, which should be previously declared as follows:
a. let min = temp[01:
b. It's not necessary, as it will be declared automatically on first use.
c. let min;
d. let min = 0;

José García 8 JavaScript - JSE-40-01


JSE1 - Final Test
We declare a movie object, with two fields: title and year:
let movie = {
title: "aga"
year: 2018
};
To change the value of the title field to "Ága" we need to perform:
a. movie{title}="Ága";
b. title->movie = "Ága";
c. movie.title = "Ága";
d. movie[title] = "Ága";

Analyze the code snippet:


let winter = ["December", "January", "February"]
let index = winter.indexof("February");
The index variable will have the value:
a. “February”
b. 3
c. 2
d. 1

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?
a. true true false
b. true 20 0
c. 20 20 0
d. 1 1 0

Select a set of data types, containing only complex types:


a. Array, Object
b. Object, String
c. Boolean, Number, Bigint
d. Array, Object, String

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?
a. 131 1.4
b. "distance" "elevation"
c. 2
d. "distance"

José García 9 JavaScript - JSE-40-01


JSE1 - Final Test
In the following code fragment, where we use setInterval, one line is missing - the place is marked in
gray:
let counter = 2;
let interval = setInterval(() => {
console.loq(counter);
}, 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?
a. while (counter-- ›= 0) clearInterval (interval);
b. if (counter-- ›= 0) clearInterval (interval);
c. clearInterval(interval);
d. if (counter-- <= 0) clearInterval (interval);

Analyze the following code:


const a = "hello":
try {
console.log(a.toUpperCase());
} catch (error)
console.log(a)
} finally {
console.loq(a);
}
What will happen as a result of its execution?
a. The following words will appear in the console: hello, hello
b. The word HELLO will appear in the console.
c. The words HELLO, hello, hello will appear in the console on subsequent lines.
d. The following words will appear in the console: HELLO, hello .

Analyze the following code:


for (let a = 5; a > 2; a--) {
console.log(a)
}
Which statement can replace the for from the example?
a. let counter = 0;
while (counter++ < 10) console.log (counter++);
b. let counter = 1;
while (counter++ < 10) console.log (counter++);
c. let counter = 0;
while (counter < 10) console.loq(counter++);
d. let counter = 0;
while (counter < 9) console.log (counter++);

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}, S{d}, ${e}`);
What will appear on the console as a result?
a. 30, 30, 20, 100, 2
b. 30, 31, 39, 100, NaN
c. 2010, 2010, 20-1010, 0100, NaN
d. 2010, 30, 1010, 0100, NaN

José García 10 JavaScript - JSE-40-01


JSE1 - Final Test
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:
a. let counter = 0; ;;user visit counter
b. let counter = 0; /* user visit counter
c. let counter = 0; // user visit counter
d. // let counter = 0; user visit counter

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 ?
a. let power = (x, y) => X * y;
b. let power = (x, y) => x ** y;
c. let power = 9;
d. let power = () => a ** b;

José García 11 JavaScript - JSE-40-01

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy