FormData: entries() method - Web APIs | MDN

Syntax

Parameters

None.

Return value

An iterator of FormData's key/value pairs.

Examples

js

formData.append("key1", "value1");
formData.append("key2", "value2");

// Display the key/value pairs
for (const pair of formData.entries()) {
  console.log(pair[0], pair[1]);
}

The result is:

key1 value1
key2 value2

Specifications

This feature does not appear to be defined in any specification.

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.