From 93ef83daf1234bb0a5d64fa5b0415623f8d7f2bb Mon Sep 17 00:00:00 2001 From: ellipse120 Date: Tue, 10 Dec 2024 18:23:53 +0800 Subject: [PATCH] docs(note): add formData2Object --- note.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/note.md b/note.md index 4a10da9..99fa52b 100644 --- a/note.md +++ b/note.md @@ -4701,3 +4701,17 @@ console.log(bar[Symbol.toStringTag]) // Bar - 6. Window alert dialog and dialog are the only two roles in this category --- + +## 169. `FormData` to `Object` + +```js +const formData = new FormData() +formData.append('a', 1) +formData.append('b', 2) + +const v = Object.fromEntries(formData.entries()) +console.log(v) +``` + +--- +