8000 Typo. by rtlechow · Pull Request #35 · raganwald-deprecated/homoiconic · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Typo. #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 2013/01/madness.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Shouts of "William-Thomas-Fredrick" ensue. The strange behaviour of `.map(parseI
2. `.map` is designed such that it passes *three* parameters to the mapper function. The first is the element, the second is the index of the element, and the third is the context (the array, in this case).
3. `.parseInt` works just fine with one parameter, but [you can also pass an additional parameter to define the radix](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseInt).

So what happens here? Well, the `.map` method is passing in a string and a number on each call, and `porseInt` is interpreting that number as a radix. Boom.
So what happens here? Well, the `.map` method is passing in a string and a number on each call, and `parseInt` is interpreting that number as a radix. Boom.

Okay. So?

Expand Down Expand Up @@ -52,7 +52,7 @@ splat(parseInt)(['1', '2', '3'])
//=> [1, 2, 3]
```

Splat look a little different than map because instead of operating directly on an array, it turns a function expecting one argument into a "splatter" expecting an array. And of course, there's a `splatWithIndex` if that's what you need, although your shoudl probably just use `.map` for that.
Splat look a little different than map because instead of operating directly on an array, it turns a function expecting one argument into a "splatter" expecting an array. And of course, there's a `splatWithIndex` if that's what you need, although your should probably just use `.map` for that.

### use a safer function

Expand Down Expand Up @@ -100,4 +100,4 @@ My recent work:

[Reg Braithwaite](http://braythwayt.com) | [@raganwald](http://twitter.com/raganwald)

[allong.es]: http://allong.es
[allong.es]: http://allong.es
0