Parsing array from GET parameters in node.js express

Windix Feng
1 min readDec 19, 2018

--

From my testing, node.js express (4.16.4) supports parsing array from GET parameters automatically in two ways:

Method1:

URL?a=1&a=2

Method2: (I am from PHP background, this method works with PHP $_GET too)

URL?a[]=1&a[]=2

In node.js:

req.query.a # => ['1', '2']

--

--

No responses yet