Top "Conditional" questions

In computer science, conditional statements, conditional expressions and conditional constructs are features of a programming language which perform different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false.

JavaScript: empty array, [ ] evaluates to true in conditional structures. Why is this?

I was encountering a lot of bugs in my code because I expected this expression: Boolean([]); to evaluate to false. …

javascript arrays object conditional
AngularJS ng-class multiple conditions with OR operator

I try to find out the good syntax for adding classes depending on angular values. I want to activate a …

angularjs conditional ng-class
Conditional If Statement: If value in row contains string ... set another column equal to string

EDIT MADE: I have the 'Activity' column filled with strings and I want to derive the values in the 'Activity_2…

python string if-statement conditional contains
Excel - Conditional Formatting - Cell not blank and equals 0

I'm trying to check if a cell is: blank, and if false (not blank) If value equals 0. I have tried: =…

excel formatting conditional formula
How do I write a complex multi-line if condition in Ruby?

How do I write this multi-line, complex condition if statement in Ruby? if ( (aa != nil && self.prop1 == aa.…

ruby if-statement conditional conditional-statements
MVC3 Conditionally disable Html.TextBoxFor()

I have a C# .Net web app. In that app I need to conditionally disable Html.TextBoxFor controls (also Html.…

asp.net-mvc-3 conditional html.textbox
C# conditional AND (&&) OR (||) precedence

We get into unnecessary coding arguments at my work all-the-time. Today I asked if conditional AND (&&) or OR (||) …

c# conditional conditional-operator operator-precedence associativity
Inline conditions in Lua (a == b ? "yes" : "no")?

Is there anyway to use inline conditions in Lua? Such as: print("blah: " .. (a == true ? "blah" : "nahblah"))

lua conditional ternary
Ruby ternary operator without else

Is there a ruby idiom for "If do-this," and "do-this" just as a simple command? for example, I'm currently doing …

ruby operators conditional conditional-operator
Kendo ui grid if else condition

What is wrong with my code? I have to check in kendo UI grid is there "OrderType 20" in my column. …

javascript if-statement kendo-grid conditional