Which of the following objects correctly implements Config with only url provided and no errors?
hard
A. { url: "http://example.com", timeout: undefined, retries: undefined }
B. { url: "http://example.com", timeout: null }
C. { url: "http://example.com", timeout: 0, retries: 3 }
D. { timeout: 1000, retries: 3 }
Solution
Step 1: Check required properties
The url property is required and must be present.
Step 2: Validate optional properties usage
Optional properties can be omitted or set to undefined without error.
Step 3: Analyze each option
{ url: "http://example.com", timeout: undefined, retries: undefined } has url and optional properties set to undefined, which is valid. { url: "http://example.com", timeout: null } uses null which is not assignable to number. { url: "http://example.com", timeout: 0, retries: 3 } includes optional properties but that is allowed, but question asks for only url provided. { timeout: 1000, retries: 3 } misses required url property.