A convention. Typically query strings are parsed into an object
with corresponding keys - necessarily unique - with string values. So
multiple `k` parameters would collapse onto single value in that object.
Adding `[]` can indicate to the parser that it should instead push each new
`k` value into an array.


On 16 December 2013 11:53, Matt Chadburn <notifications@github.com> wrote:

> In common/app/assets/javascripts/modules/commercial/loader.js:
>
> > +        this.userSegments   = 'seg=' + (new History().getSize() <= 1 ? 'new' : 'repeat');
> > +        this.components     = {
> > +          masterclasses: this.host + 'masterclasses.json?' + this.userSegments + '&s=' + this.section,
> > +          travel:        this.host + 'travel/offers.json?' + this.userSegments + '&s=' + this.section + '&' + this.getKeywords(),
> > +          jobs:          this.host + 'jobs.json?' + this.userSegments + '&s=' + this.section + '&' + this.getKeywords(),
> > +          soulmates:     this.host + 'soulmates/mixed.json?' + this.userSegments + '&s=' + this.section
> > +        };
> > +        return this;
> > +    };
> > +
> > +    Component.define(Loader);
> > +
> > +    Loader.prototype.getKeywords = function() {
> > +        return this.keywords.split(',').map(function(keyword){
> > +           return 'k=' + encodeURIComponent(keyword.replace(/\s/g, "-").toLowerCase());
> > +        }).join('&');
>
>  k[]=val1&k[]=val2
>
> Is this just a convention or is there some technical reason for it?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/guardian/frontend/pull/2536/files#r8364412>
> .
>

Please consider the environment before printing this email.
------------------------------------------------------------------
Visit theguardian.com   

On your mobile, download the Guardian iPhone app theguardian.com/iphone and our iPad edition theguardian.com/iPad   
Save up to 33% by subscribing to the Guardian and Observer - choose the papers you want and get full digital access.
Visit subscribe.theguardian.com

This e-mail and all attachments are confidential and may also
be privileged. If you are not the named recipient, please notify
the sender and delete the e-mail and all attachments immediately.
Do not disclose the contents to another person. You may not use
the information for any purpose, or store, or copy, it in any way.
 
Guardian News & Media Limited is not liable for any computer
viruses or other material transmitted with or as part of this
e-mail. You should employ virus checking software.
 
Guardian News & Media Limited
 
A member of Guardian Media Group plc
Registered Office
PO Box 68164
Kings Place
90 York Way
London
N1P 2AP
 
Registered in England Number 908396

--------------------------------------------------------------------------