Jonkman Microblog
  • Login
Show Navigation
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. Erik Moeller (eloquence@social.coop)'s status on Saturday, 27-Jan-2018 17:47:04 EST Erik Moeller Erik Moeller

    One of my favorite things about ES2015 is destructuring + object literals + argument default values.

    It makes passing data around a lot easier -> shorter functions -> more maintainable/readable code. E.g.:

    getPixels = ({ width = 1280, height = 1024 } = {}) => width * height;

    I can call it like so:

    getPixels(); // returns 1280*1024

    or like so:

    const width = 1024, height = 768;
    getPixels({ width, height });

    or of course:

    getPixels({ width: 1024, height: 768 });

    In conversation Saturday, 27-Jan-2018 17:47:04 EST from social.coop permalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

Jonkman Microblog is a social network, courtesy of SOBAC Microcomputer Services. It runs on GNU social, version 1.2.0-beta5, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Jonkman Microblog content and data are available under the Creative Commons Attribution 3.0 license.

Switch to desktop site layout.