Skip to content

Commit d5c28aa

Browse files
author
russom
committed
If !pair added for checking empty strings.
1 parent c4dec19 commit d5c28aa

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎Sprint-2/implement/querystring.js‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ function parseQueryString(queryString) {
66
const keyValuePairs = queryString.split("&");
77

88
for (const pair of keyValuePairs) {
9+
if (!pair) {
10+
continue;
11+
}
912
const everything = pair.split("=");
1013
const key = everything.shift();
1114
const value = everything.join("=");
1215
queryParams[key] = value;
13-
14-
//console.log(key);
15-
//console.log(values);
16-
//const [key, value] = pair.split("=");
17-
//queryParams[key] = values;
1816
}
1917

2018
return queryParams;

0 commit comments

Comments
 (0)