Pick the JavaScript code for the following pseudocode. If age >= 65 Then discountRate = 0.10 End If Group of answer choices
if (age >= 65) Then { discountRate == 0.10; }
end if if (age >= 65) { discountRate == 0.10 }
end if if (age >= 65) Then { discountRate = 0.10; }
if (age >= 65) { discountRate = 0.10; }

Respuesta :

Answer:

if (age >= 65) { discountRate = 0.10; }

Explanation:

In the actual javascript code there are no then used in the syntax.The (==) equal operator checks that both the operands are equal or not it is known to check loose equality in javascript.So to assign a value we use = operator.

In the if statement we write the condition.

if (age >= 65) { discountRate = 0.10; } is correct.