Content deleted Content added
Citation bot (talk | contribs) Add: publisher. | Use this bot. Report bugs. | Suggested by Abductive | #UCB_webform 206/3850 |
m Use arrow function expressions |
||
Line 102:
// Return a list of all books with at least 'threshold' copies sold.
function bestSellingBooks(threshold) {
return bookList.filter(book => book.sales >= threshold);
}
</syntaxhighlight>
The arrow operator <code>
A function may create a closure and return it, as in this example:
Line 116 ⟶ 114:
// using an interval of dx, which should be appropriately small.
function derivative(f, dx) {
return
}
</syntaxhighlight>
|