• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 9 páginas
Examen

JAVASCRIPT FINAL EXAM 2026.pdf 1. Document information

Document preview thumbnail
Vista previa 2 fuera de 9 páginas

JAVASCRIPT FINAL EXAM 1. Document information

Vista previa del contenido

JAVASCRIPT FINAL EXAM 2026/2027 QUESTIONS AND
SOLUTIONS RATED A+
✔✔Math.random() - ✔✔Generates a random floating point number between 0 & 1. To
convert this to a number range that we want - for example a random number between 1
& 10. First we multiply the result of Math.random() by 10 (the amount of potential
numbers from 1 to 10) - this will give us numbers that range from 0 to 9.99999. Because
Math.random() won't ever return the whole number 1 and to remove the decimal places,
we use Math.ceil()to round the result of Math.random()*10 up to the nearest whole
number. See more on the Math object.

✔✔What type of language is JavaScript? - ✔✔It is a scripting language.

✔✔What is a scripting language? - ✔✔A scripting language is a lightweight
programming language.

✔✔What would be the result of the following code?
<script>
document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph</p>");
</script> - ✔✔It will write what is between the <h1> and <p> tags to the browser screen
formatted accordingly to the respective HTML tags

✔✔What happens if you call the "document.write" function after the document has fully
loaded? - ✔✔The html document will be deleted and replaced by your new content.

✔✔The alert() function is not much used in JavaScript. What is it is useful for? - ✔✔It is
often quite handy for trying out code.

✔✔What will this code do?
<p id="demo"> JavaScript can change the content of an HTML element.</p>
<script>
function myFunction() {
x=document.getElementById("demo"); // Find the element
x.innerHTML="Hello JavaScript!"; // Change the content
}
</script> - ✔✔It will change the text between the <p> tags to the content in quotes after
x.innerHTML
Hello JavaScript!

✔✔What does this piece of code tell the computer to do ?
x=document.getElementById("demo") - ✔✔Find the Element ("demo");
document.getElementById("some id")
(The "Id" could be anything else.)

, ✔✔What does this piece of code tell the computer to do?
x.innerHTML="Hello JavaScript!"; - ✔✔Change the content of the x variable to Hello
JavaScript!

✔✔parseInt: If the first character cannot be converted to a number, what is returned? -
✔✔NaN

✔✔What does parseFloat do? - ✔✔It parses its argument, and returns a floating point
number. If it encounters a character other than a sign (+ or -), numeral (0-9), a decimal
point, or an exponent, it returns the value up to that point and ignores that character and
all succeeding characters. Leading and trailing spaces are allowed.

✔✔Math.random() - ✔✔This function returns a floating-point, pseudo-random number in
the range 0 to 1 — that is, from 0 (inclusive) up to but not including 1 (exclusive) —
which you can then scale to your desired range. The implementation selects the initial
seed to the random number generation algorithm; it cannot be chosen or reset by the
user.

✔✔What is the DOM? - ✔✔The DOM is a representation of a webpage that JavaScript
can use.

✔✔Object Prototype - ✔✔function Person(first, last, age, eyecolor) {
this.firstName = first;
this.lastName = last;
this.age = age;
this.eyeColor = eyecolor;

✔✔Which index is zero based? (The first element is 0, the second is 1, and so on.) -
✔✔Array

✔✔pop() - ✔✔Removes the last element of an array, and returns that element

✔✔push() - ✔✔Adds new elements to the end of an array, and returns the new length

✔✔shift() - ✔✔Removes the first element of an array, and returns that element

✔✔splice() - ✔✔adds/removes items to/from an array, and returns the removed item(s)

✔✔unshift() - ✔✔Adds new elements to the beginning of an array, and returns the new
length

✔✔children - ✔✔children property returns a collection of an element's child elements,
as an HTMLCollection object

Información del documento

Subido en
20 de julio de 2026
Número de páginas
9
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$18.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
EXAMCAFE
3.5
(43)
Vendido
299
Seguidores
11
Artículos
37014
Última venta
1 semana hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes