modulu, Raul's Array map example
On Sunday, September 22, 2013, Benjamin (Inglor) Gruenbaum wrote:
I just asked Raul's weird syntax question in SO and tried to answer it myself. Going through the spec, I have to admit that he has a point and things could be clearer. I think the JS spec being good is a big factor not only for implementers but for developers too and it could be better :)
However, admittedly I'm not a great writer myself and I don't know how the spec itself could be clearer in this case, and it was good *enough *for me as someone who has already read the spec to walk through. It would be great if that would be the case for new developers too.
stackoverflow.com/questions/18947892/creating-range-in-js-strange-syntax
I think you mean API, not syntax. Using Array.apply(null, arraylike) where arraylike = some object with a length property to create an empty array isn't the sort of content that belongs in a normative specification—it's merely an interesting use of the language's API. The parts of the expression in Ben's tweet are all explicitly specified in the standard.
Yeah sorry. English is not my first language. I definitely meant API. It's not as much about that specific case but about your point on the spec and developers. Thanks again.
Benjamin
I just asked Raul's weird syntax question in SO and tried to answer it myself. Going through the spec, I have to admit that he has a point and things could be clearer. I think the JS spec being good is a big factor not only for implementers but for developers too and it could be better :)
However, admittedly I'm not a great writer myself and I don't know how the spec itself could be clearer in this case, and it was good *enough *for me as someone who has already read the spec to walk through. It would be great if that would be the case for new developers too. stackoverflow.com/questions/18947892/creating-range-in-js-strange-syntax
The exact same thing goes to modulo in the spec
Benjamin
---------- Forwarded message ----------