Ask Question
2 February, 12:27

In jаvascript what does the if function do?

+4
Answers (2)
  1. 2 February, 16:00
    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. 2 February, 16:23
    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?
Get an answer to your question ✅ “In jаvascript what does the if function do? ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers