javascript - CoffeeScript curiousity about splat & this implementation -
Therefore, looking for some code with functional & amp; Shredder as its driver .. I am looking at the Spelat usage of this conference, and although I am "watching" in compiled javascript, I have not found any mention of docs etc. .. "Split usage for coffeeclubs at the end of the line (see below).
For example, we have:
flip = (f) - & gt; (Eg ...) -> F. as.reverse () ...
compiled:
flip = function (f) { Return function () as in {var as; as = 1 & lt; = arguments.length? __slice.call (logic, 0): []; return f.apply (empty, as.reverse ());}} ;
Now, I understand that "as ..." is being used in this form:
like = 1 < = Arguments.length? __slice.call (logic, 0): [];
Taking arguments and giving them "h . "
But, the one who is not wrapping over my head, it is used here:
-> F as.reverse (). ..include "..."
If I delete it ('...'), then the "applied" gets compiled. .. So, what is the conference to use "..." and I remember this concept in my coffeescript knowledge.
is nothing special about ...
is happening at the end of the line.
What you see here is the difference between a different parameter and a different argument. For both codes, the ...
operator is used because they are related, it can be confusing, however, because these uses are inverted to each other.
as.reverse () ...
a f
code>. The compiled javascript uses f.apply
to break as.reverse ()
in many arguments for the receiver f
.
In the form of ...
is a different parameter used in compiling javascript in __ slices
in the array inside the receiver arguments
Used to change the object, to collect logic in a list.
Comments
Post a Comment