FormData.entries()
메서드는 이 객체에 포함된 모든 key/value 쌍을 통과하는 iterator
를 반환합니다. 각 쌍의 key는 USVString
객체입니다; value는 USVString
또는 Blob
중 하나입니다.
메모: 이 메서드는 웹워커(Web Workers)에서도 사용할 수 있습니다.
Syntax
formData.entries();
Return value
iterator
를 리턴합니다.
Example
// Create a test FormData object
var formData = new FormData();
formData.append('key1', 'value1');
formData.append('key2', 'value2');
// Display the key/value pairs
for(var pair of formData.entries()) {
console.log(pair[0]+ ', '+ pair[1]);
}
결과는 다음과 같습니다:
key1, value1 key2, value2
Specifications
Specification | Status | Comment |
---|---|---|
XMLHttpRequest The definition of 'entries() (as iterator<>)' in that specification. |
Living Standard | Initial definition |
Browser compatibility
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.