[SOLVED] Check if value is negative or positive in code

How would I make this actual code?

if(value === positive)
{
   if(value < otherValue)
   {
       do thing A
   } 
}
else
{
   if(value is > otherValue)
   {
       do thing B
   }
}

EDIT: Maybe if positive is a boolean?

var isPositive = false;

if(value > 0)
{
  isPositive = true;
}
else
{
  isPositive = false;
}

Not 100% sure what you’re asking but hopefully this helps:

if (value > 0) {
    // value is positive
    if (value < otherValue)
        do thing A
} else {
    // value is negative
    if (value > otherValue)
        do thing B
}
1 Like

How did I not see that before? Oh well, thanks!

1 Like