How to inspect FormData?

前端 未结 15 1646
悲&欢浪女
悲&欢浪女 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:48

    ES6+ solutions:

    To see the structure of form data:

    console.log([...formData])
    

    To see each key-value pair:

    for (let [key, value] of formData.entries()) {
      console.log(`${key}: ${value}`);
    }
    

提交回复
热议问题