Quiz and Test Module 3
Quiz and Test Module 3
Índice
JAVASCRIPT ESSENTIALS 1 (JSE) - MODULE 3 .............................................................................................................................3
JAVASCRIPT ESSENTIALS 1 (JSE) MODULE 3 ........................................................................................................................................................... 3
Operators and User Interaction ............................................................................................................................................................................. 3
QUIZ ....................................................................................................................................................................................................................4
TEST ...................................................................................................................................................................................................................6
• know what operators are and how to classify them (by type of operand, by number of operands, etc.);
• be able to use assignment, arithmetic, logical, and comparison operators in practice;
• understand the operation of the conditional operator and the typeof, instanceof, and delete operators;
• understand what the precedence and associativity of basic operators are and be able to influence them
by means of bracket grouping;
• be able to perform basic two-way communication with the program user using the alert, confirm, and
prompt dialog boxes.
The number 3 is stored in the variable x: (let x =3;). The command x=x*x wasthen called. This last command can
be replaced using:
a. x**=2;
b. x**=x;
c. x+=x;
d. x*= 2;
The string "1024" has been written into the str variable: (let str - "1024";).
Then the operation str = -str is performed. As a result, the variable str will contain:
a. -1024
b. "1024"
c. "-1024"
d. NaN
The result of the operation true && false I| true will bet
a. null
b. true
c. false
d. 1
Which operator do we use if we want to check if two variables store different values?
a. !==
b. <>
c. Diff
d. =!
Which method will display a dialog box that allows the user to type in any string?
a. alert
b. confirm
c. prompt
d. fill
The confirm method allows you to create a dialog box. What value does this method return when the user closes
the window?
a. It depends on the option selected by the user.
b. It always returns false .
c. The string entered by the user.
d. It always returns true.
The confirm method allows you to create a dialog box. What value does this method return when the user closes
the window?
a. The string entered by the user.
b. It depends on the option selected by the user.
c. Always false.
d. Always true
The string "12" has been written into the str variable: ( let str = "12"; ). Then the operation str = +str is
performed. As a result, the variable str will contain:
a. NaN
b. “+12”
c. “12”
d. 12
Which operator do we use if we want to check if two variables store the same values of exactly the same type?
a. ===
b. =
c. !==
d. ==
The methods window.alert, window.confirm, and window.prompt are methods of the window object.
Which of the following is not true?
a. The methods window.alert, window.confirm, and window.prompt are methods of the window object. Which
of the following is not true?
b. The window object represents the window in which the HTML document containing the JavaScript code
currently being executed is open.
c. The alert, confirm, and prompt methods display information in modal windows that block access to the
page until they are closed.
d. You can call window methods, such as window.alert, without including the name window, so calling alert
("abc") would be correct.