JS Built-ins
Filebeginner

File β€” size property

πŸ“– Usage Example
const f = new File(['data'], 'file.json', { type: 'application/json' })
f.type  // β†’ 'application/json'

Set the type option to specify the MIME type of the file.

File size Property

Since File extends Blob, it has a size property reflecting the byte count of its content.

Challenge: Verify that new File(['hello'], 'test.txt').size === 5.

πŸ’‘ Hints (1)
  • β€’ File inherits size from Blob.