What's the difference between a comma separated conditional and one that uses a double ampersand

Viewed 3743

I've recently come across this type of scenario using if/let and understand what it does thanks to this post. To my understanding, both conditions need to be met before the proceeding block is executed. I now have come to a point where I've seen it in a regular conditional statement:

if existingTextHasDecimalSeparator != nil, replacementTextHasDecimalSeparator != nil {
    return false
} else {
    return true
}

What's the difference between doing the above and simply using && as seen below?:

if existingTextHasDecimalSeparator != nil && replacementTextHasDecimalSeparator != nil {
    return false
} else {
    return true
}
2 Answers
Related