Skip to content

Commit e298a32

Browse files
committed
removed duplicate loop
1 parent aac3c62 commit e298a32

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

‎Sprint-2/implement/querystring.js‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
function parseQueryString(queryString) {
22
const queryParams = {};
3-
if (queryString === "") {
4-
return queryString;
5-
}
63
if (queryString.length === 0) {
74
return queryParams;
85
}
9-
106
const keyValuePairs = queryString.split("&").filter((pair) => pair !== "");
117

128
for (const pair of keyValuePairs) {
@@ -22,7 +18,6 @@ function parseQueryString(queryString) {
2218
key = pair.slice(0, indexFirstEqual);
2319
value = pair.slice(indexFirstEqual + 1);
2420
}
25-
2621
key = decodeURIComponent(key.replace(/\+/g, " "));
2722
value = decodeURIComponent(value.replace(/\+/g, " "));
2823

0 commit comments

Comments
 (0)