How to inspect FormData?

前端 未结 15 1640
悲&欢浪女
悲&欢浪女 2020-11-22 08:23

I\'ve tried console.log and looping through it using for in.

Here it the MDN Reference on FormData.

Both attempts are in this fi

15条回答
  •  星月不相逢
    2020-11-22 08:45

    Already answered but if you want to retrieve values in an easy way from a submitted form you can use the spread operator combined with creating a new Map iterable to get a nice structure.

    new Map([...new FormData(form)])

提交回复
热议问题