Collection 04
APIs
Find the call, its return value, and the boundary that changes it.
API entries show the signature, one real input, and the value a caller actually receives. They separate what the platform returns from what a program often assumes it returns.
4 entries
Download the collection index (JSON)Index
On this shelf
| Name | Platform | Boundary question |
|---|---|---|
| When Is Response.ok True? Reference | Fetch | Which status codes make ok true, and what does it not tell you? |
| Building Arrays with Array.from() Reference | JavaScript | When does Array.from() create a real array from an iterable or array-like? |
| Resolving Paths with pathlib.Path.resolve() Reference | Python | What does resolve() change, and what does it require from the filesystem? |
| Reading Repeated Parameters with URLSearchParams.getAll() Reference | URL | Why does get() return only one value when the URL repeats a key? |
Reading path
A way in
Start with Response.ok when a status check surprises you. The URLSearchParams entry is a useful next stop when the value itself is repeated rather than missing.
- 01 When Is Response.ok True?Response.ok is true exactly when the HTTP status is 200 through 299, and false for every other status. It does not validate the body, content type, or application-level success, and opaque responses report ok as false.
- 02 Reading Repeated Parameters with URLSearchParams.getAll()get() returns only the first value for a repeated query key, while getAll() returns every value in order as an array. getAll() also returns an empty array for a missing key, where get() returns null.
All entries
Full catalog
- Building Arrays with Array.from() Array.from() builds a new array from an iterable by iterating Symbol.iterator, or from an array-like object by reading its length and indexed properties. It handles strings, Set, Map, generators, NodeList, and {length: n} objects, and throws TypeError for null or undefined.
- Reading Repeated Parameters with URLSearchParams.getAll() get() returns only the first value for a repeated query key, while getAll() returns every value in order as an array. getAll() also returns an empty array for a missing key, where get() returns null.
- Resolving Paths with pathlib.Path.resolve() resolve() makes a path absolute, collapses dot segments, expands symbolic links, and applies on-disk case on Windows. With the default strict=False the path need not exist, but resolution still reads the filesystem and can raise OSError.
- When Is Response.ok True? Response.ok is true exactly when the HTTP status is 200 through 299, and false for every other status. It does not validate the body, content type, or application-level success, and opaque responses report ok as false.