1
(this.template = this.name
            ? new UrlBuilder(name, absolute, this.ziggy).construct()
            : ''),
            (this.urlParams = this.normalizeParams(params));

I'm very confused about what the comma is doing there, source found here

t.niese
  • 39,256
  • 9
  • 74
  • 101
Philipp Mochine
  • 4,351
  • 10
  • 36
  • 68
  • If you have a better title for the question, please help me. – Philipp Mochine Oct 17 '19 at 19:50
  • 5
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comma_Operator –  Oct 17 '19 at 19:53
  • 1
    The comma operator here does not make any sense (except creating confusion), because the result of the expression is not assigned anywhere. So in the given case, it would be equal to `this.template = this.name ? new UrlBuilder(name, absolute, this.ziggy).construct() : ''; this.urlParams = this.normalizeParams(params);`. And even if the result would be assigned to something, it still would in most cases be more a sign of a bad coding style than anything useful. – t.niese Oct 17 '19 at 20:03

0 Answers0