Subject: Ingredients for anti-aging 2.0

From: Martha's Recipe for Anti-Aging <[email-masked]>
Date: Fri, 20 Jun 2014 10:51:06 -0700

Celebs Doing things -
Pics > Martha

June 18, 2014 - 

Martha Stewart Hosts Baking Demonstration in VT.

The crowd couldn't believe how good Martha looked, there were whispers of a possible facelift...

She told the crowd how she really did it:
Her Explanation -> http://www.axply.com/martha/reveals/tip.html

TMVZ Daily
See the pics of Martha that sparked this Rumor

Here -> http://www.axply.com/martha/reveals/tip.html

to stop further celeb updates - write Current Update Alerts
1644 Doral Drive_B r o o k i n g s_SouthDakota 5 7 0 0 6 or visit http://www.axply.com/4h/e44/y7jue.do4o4

First issue isn't a reason it's bad, only a difference in semantics. Second issue seems to me a reason (on top of clashes between libraries doing the same) that altering the prototype of a built-in datatype is bad, rather than that for..in is bad.   Stewart Mar 1 '11 at 0:52 
1	  	
@Stewart. The 'difference in semantics' is actually a flaw in Javascript. The broken semantics mean the code doesn't do what you think it will, and that's why the construct is typically avoided.   Triptych Mar 1 '11 at 7:55
1	  	
Arrays in JS are associative - they just can be used as linear arrays. As such, the whole point of using for..in is to iterate over the array's keys, whatever they may be.   Stewart Mar 1 '11 at 10:29 
47	  	
@Stewart: All objects in JS are associative. A JS Array is an object, so yes, its associative too, but thats not what its for. If you want to iterate over an object's keys, use for (var key in object). If you want to iterate over an arrays elements, however, use for(var i = 0; i < array.length; i += 1).   Martijn Mar 1 '11 at 15:15
  	  	
I corrected for(int i=0 to for(var i=0. The first version produces a not-very-helpful "missing semi-colon" error (at least in Firefox).   Tim Goodman Mar 1 '11 at 19:58
1	  	
So using built-in arrays as associative arrays is abusing the JS object model? Is there any official recommendation on what to use for AAs instead?   Stewart Mar 18 '11 at 11:15
13	  	
You said for the first example, that it Iterates over numeric indexes from 0 to 4, as everyone expects, I expect it to iterate from 0 to 5! Since if you add an element in position 5, the array will have 6 elements (5 of them undefined).   stivlo Oct 22 '11 at 10:53 
3	  	
This overall presents a problem in javascript, since the point of something like for..in is to be key-agnostic on objects or arrays. Quite the opposite, if you add something to array[5] you expect the array to have one item, with key 5, not five blank items that you didn't insert. You expect there to be in the array what you put in it! Unless you told the array explicitly to have five items, key '5' realistically should not indicate the number of items in the array. But this relates to what an array represents; in JSON arrays do not really have keys; to use the term key is misleading.   RiverC Feb 20 '12 at 23:13
  	  	
@stivlo - if you add an element only in position 5, the array will have 1 element as the for..in loop shows. There's a difference between an element that doesn't exist and so returns undefined when you try to access it and an element that does exist and returns undefined because that value has been explicitly assigned.   nnnnnn Aug 30 '12 at 5:37
7	  	
I think the examples would be even clearer if you set a[5] to something other than 5, say, a[5]=42. The fact that the second example ("for (x in a)" only enumerates one value is not surprising to me; the fact that the value it enumerates is 5 instead of 42 is surprising to me (coming from other languages with a similar construct that enumerates list contents instead of array indices).   metamatt Dec 3 '12 at 23:56
  	  	
In the first example.. Would it be more efficient to call a.length only once (and set to a var) prior to the loop? vs each time the loop iterates?   August Mar 22 '13 at 16:45 onnyflash, both will operate identically, since the increment of i and the print are in different statements. This should be the case for any language that supports C-style ++. The only difference between ++i and i++ will be when using the value of the operation in the same statement.   Mark Harrison Aug 16 '11 at 18:44
  	  	
So if you incremented within the loop instead of in the compound for statement it would make a difference, right? Such as for(int i=0; i<10){ print i; ++i;   jonnyflash Aug 17 '11 at 21:34
  	  	
no, since the print and increment are in different statements, the increment can be either ++i or i++. If instead you had print ++i and print i++ the results would be different.   Mark Harrison Aug 18 '11 at 0:46
6	  	
Since in most cases they produce identical code, I prefer i++ because it's of the form "operand-operator", a la an assignment "operand-operator-value". In other words, the target operand is on the left side of the expression, just like it is in an assignment statement.   David R Tribble Dec 11 '12 at 16:49
  	  	
Good answer, short and sweet.   adaam Jan 15 at 14:0