Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Cade Ward
    @cadebward
    true
    i've been using it a lot to get in contact with people who maintain repos
    its great
    but i almost want more of a "hangouts" approach as well
    mixed in
    nonetheless, this is awesome
    shall we proceed?
    Dallin Osmun
    @numso

    yes

    #1
    Cade Ward
    @cadebward
    So what would you see as the best or most elegant way to set a default value from an object? For example:
    function blah(obj) {
      var default_setting = obj.default;
      // but what if obj is optional?
      var default_setting = obj.default || 'none';
      // but if obj is missing completely, then it'll fail before it gets to the || 
    }
    oops!
    This message was deleted
    Dallin Osmun
    @numso
    haha
    sweet huh?
    Cade Ward
    @cadebward
    ah
    thats cool
    Dallin Osmun
    @numso
    function blah(obj={}) {
      var default_setting = obj.default || 'none';
    }
    yay es6
    Cade Ward
    @cadebward
    That would be nice
    Dallin Osmun
    @numso
    otherwise
    var default_setting = (obj || {}).default || 'none';
    Cade Ward
    @cadebward
    i saw that!
    Dallin Osmun
    @numso
    you saw nothing
    Cade Ward
    @cadebward
    Okay that makes sense
    I like that
    Dallin Osmun
    @numso
    yeah
    you should really start using webpack and 6to5
    makes life so much more fun
    Cade Ward
    @cadebward
    this is what i've been doing haha...
    if (obj) { default = obj.blah || 'blah': }
    (embarrassing)
    but i always hated it
    Dallin Osmun
    @numso
    haha, nice
    gonna keep testing this tool out...
    oh come on, no embed support?
    Dallin Osmun
    @numso
    whaaa?, how
    Dallin Osmun
    @numso
    try changing it here
    Cade Ward
    @cadebward
    no?
    Dallin Osmun
    @numso
    foobar
    foo is a bar in a car
    Cade Ward
    @cadebward
    but you can’t change it right?
    Dallin Osmun
    @numso
    can you see my change?
    nope
    stupid
    so if you type / topic and it doesn't autocomplete, you really don't have rights
    I typed /lurk.... not sure what it did
    Cade Ward
    @cadebward
    ohh
    yeah its almost like you can’t turn off lurk
    so now you will never see notifications in this channel
    Dallin Osmun
    @numso
    crap