code: function buffer(arr) {
      if (!Array.isArray(arr)) {
          return;
      }
  
      var l = new List();
      arr.forEach(function(el) {
          l[syncMethodName("add")](el);
      });
      return convert[syncMethodName("asScalaBuffer")](l);
  }
docs: convert a js array into a buffer