unit 2 javascript
What is the value returned by the following expression? // (0 > 1) ? x : y
Y
Which of the following statements declares a variable whose value can't be altered throughout the script?
const x = 5;
What is the data type of the value of myVar after execution? // var myVar; myVar = confirm("continue?");
Boolean
What is the return type of the confirm() method?
Boolean (either true or false)
Which of the following statements is true of JavaScript keywords and/or reserved words?
You cannot use reserved words as names for objects.
Which of the following methods let you convey information to a user and doesn't record the user's response?
alert( )
What is the value of testValue after execution?
Teenager
What is the difference between myVar1 and myVar2? // var myVar1 = "25"; var myVar2 = 25;
The data type
Which JavaScript operator indicates concatenation?
+
Which among the following operators is of highest precedence?
++
Which of the following operators is an assignment operator?
+=
What is the output of this statement? // document.write(8 / 4 * 2 + 2 / 2);
5
Which of the following data types is a non-primitive data type?
Array
What will be the result of this code snippet when run in the browser? // Consider the following JavaScript code snippet:
012
Which of the following statements is true of the undefined data type?
It is the value taken by the variables that don't have any value assigned to them.