Take the 2-minute tour ×
English Language Learners Stack Exchange is a question and answer site for speakers of other languages learning English. It's 100% free, no registration required.

Primitives are also compared by value: two values are the same only if they have the same value. This sounds circular for numbers, booleans, null, and undefined: there is no other way that they could be compared. Again, however, it is not so obvious for strings. If two distinct string values are compared, JavaScript treats them as equal if, and only if, they have the same length and if the character at each index is the same.

I can't understand what the adjective circular is supposed to mean in this context. According to dictionaries, the word has basically two definitions: when something has a round shape and the other meaning is about a logical argument being circular. Neither one appears to be fitting for the context of this paragraph.

share|improve this question
3  
"two values are the same only if they have the same value" sounds circular because the definition doesn't really give us new information; it just refers to itself. A "circular" thing in this sense might go like this: "What is 1 + 1?" "2" "Why?" "Because 1+1 = 2." "That's right, but why 2 is 1 + 1?" "Because 2 = 1 + 1." This is circular, because it doesn't go anywhere. It's like we got stuck in a loop. –  Damkerng T. Jun 14 at 1:04
    
@DamkerngT. Concise and precise. Post it! –  StoneyB Jun 14 at 1:12
    
By the way I would consider this poor writing as a native English speaker, and also poor thinking. There is nothing 'circular' here...numbers, etc. could be compared first on the basis of matching type, then on the basis of value. –  Merk Jun 14 at 8:20

1 Answer 1

up vote 6 down vote accepted

"two values are the same only if they have the same value" sounds circular because the definition doesn't really give us new information. It just refers to itself. -- "What makes two values the same?", you might wonder. And the given explanation is: when "they have the same value." Oh, great! What else the reason could be!

A "circular" dialog in this sense might go like this:

"What is 1 + 1?"
"2."
"Why?"
"Because 1 + 1 = 2."
"That's right, but why 2 is 1 + 1?"
"Because 2 = 1 + 1."

This is circular because it doesn't go anywhere. It's like we got stuck in a loop.


Here is how Macmillan Dictionary defines circular (for this sense):

 2. a circular argument or theory does not mean anything because it consists of a series of causes and effects that lead you back to the original cause

share|improve this answer
    
funny answer! yay! –  Bob the zealot Jun 14 at 1:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.