Basic And Variables - Study Mode

[#16] “An expression that can legally appear on the left side of an assignment expression.” is a well known explanation for variables, properties of objects, and elements of arrays. They are called
Correct Answer

(C) Lvalue

Explanation

Solution: lvalue is a historical term that means “an expression that can legally appear on the left side of an assignment expression.” In JavaScript, variables, properties of objects, and elements of arrays are lvalues.

[#17] JavaScript is a _______________ language
Correct Answer

(D) Object-Based

Explanation

Solution: JavaScript is not a full-blown OOP (Object-Oriented Programming) language, such as Java or PHP, but it is an object-based language.

[#18] The output for the following code snippet would most appropriately be var a = 5 , b = 1 var obj = { a : 10 } with( obj ) { alert ( b ) }
Correct Answer

(C) 1
(G) 1

Explanation

Solution: The interpreter checks obj for property b, fails and takes it from outside of with.

[#19] A conditional expression is also called a
Correct Answer

(B) Immediate if

Explanation

Solution: A conditional expression in JavaScript is also known as an immediate if or ternary operator . The correct answer is option B. Let's understand the other options: Option A, "Alternate to if-else," is not an accurate description of a conditional expression. While a conditional expression can be used as an alternative to if-else in certain cases, it is not its primary name. Option C, "If-then-else statement," is not the commonly used term for a conditional expression. It is more commonly used to refer to the traditional if-else statement structure. Option D, "None of the mentioned," is incorrect because a conditional expression does have a specific name. Therefore, option B, "Immediate if," is the correct answer as it accurately describes the conditional expression in JavaScript. It is called "immediate" because it allows for a concise way of expressing a condition and immediately returning a value based on that condition.

[#20] A statement block is a
Correct Answer

(D) block that combines multiple statements into a single compound statement

Explanation

Solution: A statement block is a block that combines more than one statements into a single compound statement for ease.