GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Sergey Shandar (functionalscript@techhub.social)'s status on Friday, 05-Apr-2024 01:32:58 JST Sergey Shandar Sergey Shandar
    in reply to
    • Axel Rauschmayer

    @rauschma omitting parentheses is one of the nice syntax sugar I use in my JS code:

    ```js
    const add = a => b => a+b
    ```

    In conversation Friday, 05-Apr-2024 01:32:58 JST from techhub.social permalink
    • Embed this notice
      Axel Rauschmayer (rauschma@fosstodon.org)'s status on Friday, 05-Apr-2024 01:33:00 JST Axel Rauschmayer Axel Rauschmayer

      #TypeScript: Arrow functions help with partial evaluation [1] – e.g. a factory for functions for which there already is a type. Then they are more elegant than using .bind() [2]

      const functionFactory = (factoryArg: string): FunctionType => (functionArg) => { … }

      Note that the type of `functionArg` and the result type of the second arrow function are provided by `FunctionType`.

      [1] https://2ality.com/2011/09/currying-vs-part-eval.html
      [2] https://2ality.com/2016/02/arrow-functions-vs-bind.html

      In conversation Friday, 05-Apr-2024 01:33:00 JST permalink

      Attachments

      1. No result found on File_thumbnail lookup.
        Currying versus partial application (with JavaScript code)
        Currying and partial application are two ways of transforming a function into another function with a generally smaller arity. While they are often confused with each other, they work differently. This post explains the details.
      2. No result found on File_thumbnail lookup.
        Arrow functions vs. `bind()`
        ES6 arrow functions are often a compelling alternative to Function.prototype.bind().

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.