Ky: DOCS: use data, not json for variable name

Created on 12 Feb 2019  路  1Comment  路  Source: sindresorhus/ky

It's a minor niggle, but would be better to use data for the variable holding the response in the documentation. JSON is a serialization standard, and in code should always be a string containing a serialized value, not the deserialized object.

Instead of: const json = await ky(url).json();

Use: const data = await ky(url).json()

Most helpful comment

Or:

const parsed = await ky(url).json();

>All comments

Or:

const parsed = await ky(url).json();
Was this page helpful?
0 / 5 - 0 ratings

Related issues

popuguytheparrot picture popuguytheparrot  路  6Comments

szmarczak picture szmarczak  路  5Comments

sarneeh picture sarneeh  路  6Comments

kraniebrud picture kraniebrud  路  3Comments

davalapar picture davalapar  路  6Comments