回答編集履歴
1
調整
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
```javascript
|
2
2
|
const txt="piyo1=hoge1,piyo2=hoge2,piyo3=hoge3";
|
3
|
-
const usp=new URLSearchParams(
|
3
|
+
const usp=new URLSearchParams(txt.replace(/,/g,'&'));
|
4
4
|
const result=JSON.stringify(Object.fromEntries([...usp.entries()]));
|
5
5
|
console.log(result);
|
6
6
|
```
|