Ask Question
23 June, 08:43

In jаvascript what does the if function do?

+5
Answers (2)
  1. 23 June, 10:40
    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. 23 June, 10:51
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers