JS Built-ins
FormDatabeginner

FormData β€” has() returns true after append

πŸ“– Usage Example
const fd = new FormData()
fd.append('k', 'v')
fd.has('k')  // β†’ true

has() returns true if the given key exists in the FormData.

FormData.has()

has(name) returns true if the key exists in the FormData.

Challenge: Append key 'x' and verify that has('x') returns true.

πŸ’‘ Hints (1)
  • β€’ has(name) checks for the presence of the key, not its value