45.7k views
3 votes
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; }

1 Answer

1 vote

Answer:

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

Step-by-step 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.

User Erik Post
by
5.6k points