The title is pretty much self-explanatory: When should one use the double-dots ..
and when the triple-dots ...
? Both are used to indicate a range.
Key Difference: Both ‘and’ and ‘or’ are conjunctions and hence are often used in a similar context. ‘And’ is a type of coordinating conjunction and is commonly used to indicate a dependent relationship. Here, the two clauses are dependent on each other and both are true and take together.
The “ = ” is an assignment operator is used to assign the value on the right to the variable on the left. The ‘==’ operator checks whether the two given operands are equal or not. If so, it returns true.
In general, using &implies a much more informal tone than and. You will never be criticized for using and, whereas you run the risk of disapproval if you use &in anything but informal notes, tweets and the like. Share Improve this answer Follow answered Oct 9 '14 at 17:18
= is called as assignment operator, == is called as comparison operator whereas It is also called as comparison operator. = does not return true or false, == Return true only if the two operands are equal while === returns true only if both values and data types are the same for the two variables.
While ranges with double dots don't include the end bound, triple dots were used for inclusive ranges, i.e. (0...2)
would contain 2
as well. This is now obsolete; use ..=
for this purpose instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With