News for hackers. Stuff that matters.
Re:Why perl has separate arrays and hashes: It's as if they ... by voyou on Tuesday June 21, 2011 @04:16PM (#2680211)
"You either instantiate an array or a hash" suggests that arrays and hashes are distinct in Javascript, but they aren't. Arrays _are_ hashes (that is, Objects) with some extra functions in their prototype which let them, in the words of the standard, "give special treatment to a certain class of property names."
Re:Why perl has separate arrays and hashes: It's as if they ... by mnutt on Tuesday June 21, 2011 @10:00PM (#2681316)
Yes, you're absolutely right. I meant that in usage you generally either instantiate a plan object and use it as a hash or you instantiate an array and use it as an array, but when you instantiate an array, you can treat it like any other object.