Possible data types

Hey ,

I'm thrilled to help you learn JavaScript. Unfortunately, you've landed on a page where you cannot access with your current purchase.

Please upgrade (use this link) access this content.

I'm super eager to help you learn more!

Possible data types

JSON is one of the many types of data we can transfer. XHR and Fetch supports different types of data.

XHR supports the following data types

  1. Array Buffer
  2. Blob
  3. Document
  4. JSON
  5. Text

Fetch supports the following data types

  1. Array Buffer
  2. Array Buffer View
  3. Blob
  4. String (which can mean text or JSON)
  5. URLSearchParams
  6. Form Data

Fetch gives you methods to transform different data types into readable JavaScript. These methods make it easier to work with Fetch.

Here are some examples:

  1. Convert Array buffers with arrayBuffer()
  2. Convert Blobs with blob()
  3. Convert JSON with json()
  4. Convert Text with text()
  5. Convert form data with formData()

Don’t worry about different data types at this point. When you work with APIs, you’ll usually work with JSON and Text only. For that reason, we’ll only talk about JSON and Text data types.

Exercise

Nothing required. For this lesson, you only need to know that there are other data types besides JSON.