title: Replacing names starting with underscore
body: <p>I'm trying to write a function to replace names starting with underscore with name with dash. replacing the first character if it starts with underscore with dash. I have done the following so far; but I need somehelp to do it recursively for nested objects; I'm looking for an elegant way to do it:</p>
  
  <pre><code>    var myObj = { name: 'foo',
        bar: {"_foo": {'_bar':{}}},
        '_baz': {}};
  
  
  Object.prototype.replaceUnderscores = function rec() {
      for (var item in this){
        if(typeof this[item] == "object"){
          this[item] = rec(this[item])
        }
        if(_.startsWith(item, '_')){
          console.log(item)
          var newName = item.replace(item[0],'-')
          this[newName] = this[item];
          delete this[item]
        }
      }
      return this;
  };
  
  myObj.replaceUnderscores()
  
  console.log(myObj);
  </code></pre>