Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between .. and ...?

Tags:

syntax

range

rust

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.

like image 354
typo Avatar asked Dec 04 '18 09:12

typo


People also ask

What is the difference between and and or and and?

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.

What is the difference between “=” and == in JavaScript?

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.

What is the difference between'&'and'&'?

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

What is the difference between = and == in C++?

= 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.


Video Answer


1 Answers

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.

like image 130
ljedrz Avatar answered Sep 28 '22 16:09

ljedrz