surffishin07 surffishin07
  • 17-11-2019
  • Computers and Technology
contestada

Which of the following is a valid JavaSript statement?
a. If (x = 5) x == 2 * x;
b. if (x = 5) x =2* x;
c. if (x == 5) x == 2 * x;
d. if (x == 5) x = 2 * x;​

Respuesta :

wyskoj
wyskoj wyskoj
  • 17-11-2019

Answer:

D

Explanation:

A and B are not valid because you cannot use "=" as a comparator (you must use "==" or "===").

C is not valid because the expression after the conditional is not a statement (it uses "==" instead of "=")

Answer Link
michaelarmstrong1337 michaelarmstrong1337
  • 18-11-2019

It is D if (x == 5) x = 2 * x;​

Answer Link

Otras preguntas

What military strategy defeated Cornwallis at Yorktown?
please solve the following equation. x-6x=56
please solve the following equation. x-6x=56
A bathtub is being filled with water. After 3 minutes 4/5 of the tub is full. Assuming the rate is constant, how much longer will it take to fill the tub?
What military strategy defeated Cornwallis at Yorktown?
Dennis had a piece of rope that was 2.7 m long. He cut the rope into 3 equal pieces. Was each piece of rope greater than or less than 1 m?
How do you use implicit differentiation to find x^2+3xy+y^3=10
please solve the following equation. x-6x=56
what is the phenotype of a heterozygous person using T for tall and t for short
please solve the following equation. x-6x=56