

In this case a and b are not the same type. I thought strings behave like value types? Well, it depends who you ask. Now it becomes interesting: var a = "12" + "3" Īlert(a = b) // returns true, because strings behave like value typesīut how about this?: var a = new String("123") Īlert(a = b) // returns false !! (but they are equal and of the same type) Strings are not value types, but in Javascript they behave like value types, so they will be "equal" when the characters in the string are the same and when they are of the same length (as explained in the third rule) There's more to the story than being equal and being of the same type.Ī = b returns true if a and b have the same value and are of the same typeĪ = b returns true if a and b reference the exact same objectĪ = b returns true if a and b are both strings and contain the exact same characters Var ab_eq = (a = b) // false (even though a and b are the same type) So, let's take the following code: var a = It actually means that both operands reference the same object, or in case of value types, have the same value. Some will say that = means equal and of the same type, but that's not really true. In the answers here, I didn't read anything about what equal means. My advice is to bypass the question entirely and just don't use the String constructor to create string objects from string literals. Which one is correct? That really depends on what you're trying to compare. Here the = operator is checking the values of the two objects and returning true, but the = is seeing that they're not the same type and returning false. For example, consider the comparison of a string primitive with a string object created using the String constructor. The special case is when you compare a primitive with an object that evaluates to the same primitive, due to its toString or valueOf method. For objects, = and = act consistently with one another (except in a special case). All of the comparisons just shown produce false with the = operator.Ī good point was brought up by in the comments and in Laybaert's answer concerning objects. My advice is to never use the evil twins. These are some of the interesting cases: '' = '0' // false the rules by which they do that are complicated and unmemorable. The evil twins do the right thing when the operands are of the same type, but if they are of different types, they attempt to coerce the values. If the two operands are of the same type and have the same value, then = produces true and != produces false. The good ones work the way you would expect. JavaScript has two sets of equality operators: = and !=, and their evil twins = and !=. To quote Douglas Crockford's excellent JavaScript: The Good Parts, The = operator will not do the conversion, so if two values are not the same type = will simply return false. The = operator will compare for equality after doing any necessary type conversions. Reference: Javascript Tutorial: Comparison Operators No tags or contexts.The strict equality operator ( =) behaves identically to the abstract equality operator ( =) except no type conversion is done, and the types must be the same to be considered equal.

Wrike - Not priced for use as a task manager.Trimpath Next Action - Web only (with offline access).Todoist - "Mac app" is really just a SSB (site specific browser).I'm at home, and I want to see everything I could do there, including do-anywhere items too.) Has AppleScript support. Taskmate - iPhone and Mac versions don't talk to each other at all.Smartsheet - Priced unreasonably for use as a task list manager.Sync is manual, and requires action on both phone and desktop. I really want offline capability, and it relies on Google Gears which doesn't run on modern browsers. Remember the Milk - Doesn't support moving tasks around in the list.Remember (by Lighthead) - No iPhone support.Probably abandoned, since the developer went to work on Things. Has auto-sync, but it costs $5 per month. Helium - Can't show both and simultaneously.Frictionless - Fails to start with OS X Lion.Sync is manual, and iPhone sync is via WiFi only, although the Mac edition can sync with web edition every 10 minutes. EasyTask - Can't show both and simultaneously.Doit () - Has only a "mini" version for Mac.Circus Ponies Notebook - Great Mac app.Can't show contexts simultaneously, but CAN show TAGS simultaneously. Todo (Appigo) - *** Worth doing a deeper dive ***.ThinkingRock - *** Worth doing a deeper dive ***.I can get it to show me home+any tasks at the same time. The Hit List - *** Worth doing a deeper dive ***.Taskpaper - *** Worth doing a deeper dive ***.OmniFocus - *** Worth doing a deeper dive ***.

A brief survey of some of the task/to-do list managers for Mac OS X (including some web-only products)…
