Answer the question
In order to leave comments, you need to log in
How to interact with the console in NodeJs?
Interested in the interaction of the vanilla node with the console.
For example, make a console calculator on nodejs, without any additional. plugins.
Is it possible to?
Googling found only the implementation through plugins.
Answer the question
In order to leave comments, you need to log in
$a=4;
$b=10;
$z= $a*$b;
if ($a && $b > -1) {
echo $a-$b;
}
elseif ($a && $b < 0) {
echo $a * $b;
}
elseif ($z < -1) {
echo $a+$b;
}
Parentheses are of course correct, but the "magic" is not in them, the initial problem is that there are extra semicolons.
The parser understood your version as:
$a=4;
$b=10;
$z= $a*$b;
if ($a && $b > -1) {
echo $a-$b;
} elseif ($a && $b < 0) {};
echo $a * $b; // уже выполнится без условия
elseif ($z < -1) {}; // соответственно уже вообще не относится к предыдущему if'у
echo $a+$b;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question