Skip to content
Open
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions tsguide.html
Original file line number Diff line number Diff line change
Expand Up @@ -1561,8 +1561,8 @@ <h4 id="functions-as-callbacks" class="numbered">Prefer passing arrow functions
<p>Instead, prefer passing an arrow-function that explicitly forwards parameters to
the named callback.</p>

<pre><code class="language-ts good">// GOOD: Arguments are explicitly passed to the callback
const numbers = ['11', '5', '3'].map((n) =&gt; parseInt(n));
<pre><code class="language-ts good">// GOOD: we only forward the string (and an explicit radix)
const numbers = ['11', '5', '3'].map((n) =&gt; parseInt(n,10));
// &gt; [11, 5, 3]

// GOOD: Function is locally defined and is designed to be used as a callback
Expand Down