• ¿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 4 fuera de 42 páginas
Examen

Javascript Study Questions With All Correct Answers

Document preview thumbnail
Vista previa 4 fuera de 42 páginas

JAVASCRIPT STUDY QUESTIONS WITH ALL CORRECT ANSWERS

Vista previa del contenido

JAVASCRIPT STUDY QUESTIONS
WITH ALL CORRECT ANSWERS

What is the DOM? - Answer-Document Object Model

What is AJAX? - Answer-Asynchronous JavaScript And XML

Is JavaScript case sensitive? - Answer-Yes

How do statements end in JavaScript? - Answer-With a semicolon ";"

How do you create a single line comment in JavaScript? - Answer-With two forward
slashes "//"

How do you create a multi-line comment in JavaScript? - Answer-Start with a forward
slash and asterisk, and then end with an asterisk and forward slash. "/*" "*/"

What are the valid characters for an identifier in JavaScript? - Answer-Letters, Numbers,
Underscores, and Dollar Signs

How do you denote a string in JavaScript - Answer-With either single or double quotes
surrounding the data

What is the string escape sequence to start a new line in JavaScript? - Answer-\n


Calling an external javascript file syntax? - Answer-<script type="text/javascript"
src="javascript.js"> </script>

Is javascript case sensitive? - Answer-yes!

Javascript comment syntax? - Answer-/**/ for multiple lines
// for a single line

If a variable is not a function and does not have var then it is? - Answer-a global
variable

Can variables include other variables? - Answer-yes

x=x+y is the same as what? or x=x/y? - Answer-x+=y or x/=y

,numbers + strings =?
5+"5" = ? - Answer-strings
55

javascript starts counting on what? - Answer-0

numerical comparison operators? - Answer-x==y [x is equal to y]
x===y [x is exactly equal to y]
!= [not equal to]
> [greater than]
< [less than]
>= [greater than or equal to]
<= [less than or equal to]

logical operators? - Answer-&& [and]
|| [or]
! [not]
? ternary operator

conditional variable syntax? - Answer-z=(x==y)?5:6
z = 5 if x=y;
z = 6 if x!=y;

else if conditional syntax? - Answer-if(condition)
{
code
}
else if(condition)
{
code
}

switch statement syntax? - Answer-switch(variable)
{
case 1;
code
break;

case "example";
code
break

default;
code
}

,alert box syntax? - Answer-alert("message");

confirm box syntax? - Answer-r=confirm("press a button")
if(r==true)
{
alert('you pressed ok!');
}
else
{
alert('you pressed cancel');
}

prompt box syntax? - Answer-x="prompt("text here","default value");
if(x!="null" && x!="")
{
alert("hello "+x+" how are you today?")
}

syntax for line breaks in an alert box? - Answer-'/n' + " here"

function syntax and purpose? - Answer-function functionName(var1,var2,..,var99)
{
some code
}
functions allows scripts to be executed when called.

return statement syntax? - Answer-function product(a,b)
{
return a*b;
}
alert(product(4,3)) <-- will alert 12
return function gives a value back based on function variables.

javascript syntax for a (limited loop based on specifications) syntax? - Answer-
for(variable=startvalue;variable<=endvalue;variable=variable+increment)
{
code to be run until loop is complete.
}

The while loop (a loop executed when a specific condition is met) syntax? - Answer-
while(variable<=endvalue)
{
code to be executed
}

the break and continue statement? - Answer-if(i==3)

, {
break;
}
breaks loop

if(i==3)
{
continue;
}
breaks loop and restarts at next value;

for... in statement syntax? - Answer-var person={fname:"john",lname:"doe",age:"25"};
var x;
for (x in person)
{
document.write(person[x]+" ");
}
-------
loops through all variables attached to person;

HTML DOM mouse events? - Answer-onclick
ondblclick
mousedown
mousemove
mouseover
mouseout
mouseup

onsubmit should be used for what and where? - Answer-validating form fields
ex. <form action="blah.asp" method="post" onsubmit="return checkForm()">

special text insertions? - Answer-\' single quote
\" double quote
\n new line
\r carriage return
\t tab
\b backspace
\f form feed

properties of methods defined? - Answer-properties - are values associated with an
object i.e. length

methods - are actions (functions) that can be performed on objects ie toUpperCase [an
uppercase method]

Información del documento

Subido en
14 de julio de 2025
Número de páginas
42
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$13.89

¿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.
Scholarsstudyguide
3.8
(169)
Vendido
853
Seguidores
476
Artículos
16409
Ú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