Ask Question

In jаvascript what does the if function do?

+1
Answers (2)
  1. 14 January, 08:11
    0
    An "if" statement is a conditional statement in jа vascript.

    It is a fundamental control statement that allows to make decisions and execute statements conditionally.

    The syntax for it is -

    if "expression"

    (

    condition to be executed if the "expression" is true

    )

    The "expression" is evaluated for its truthfulness. If it is true, then the "inner condition" will be executed. If it is false, then no "inner condition" is executed.
  2. 14 January, 08:20
    0
    The if function is like cross roads. For example lets say you have and the variable x = place and y = speed 'If (x>4) {y=-4}' Then when the x reaches 4 it goes backwards at the speed of 4, so basically the command is that if the situation is correct it goes on and if not it just repeats until the situation is correct.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “In jаvascript what does the if function do? ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers