Results for “required”
Small, practical examples. Search by task or narrow things down below.
Merge object settings
Use object spread to apply JavaScript overrides to defaults.
JavaScript✓ Tested
Merge two dictionaries
Combine two dictionaries into a new dictionary. When a key appears in both inputs, the value from the second dictionary wins.
dictionary✓ Tested
Pad a numeric label
Convert a number to text and pad it to a fixed width.
JavaScript✓ Tested
Parse a JSON string
Convert a JSON string into a Python dictionary and read values by key.
json✓ Tested
Parse and format a date
Convert a date string into a datetime object, then format it in a different, human-readable order.
date✓ Tested
Parse JSON text
Read a JavaScript object from JSON text.
JavaScript✓ Tested
Prevent an item from shrinking
CSS: Flex-shrink zero preserves a required size even when the container overflows.
CSS✓ Tested
Read a JSON file
Load a JSON document from disk into Python objects using an explicitly selected text encoding.
json✓ Tested
Read a nested value safely
Combine optional chaining with nullish coalescing in JavaScript.
JavaScript✓ Tested
Read a text file
Open a UTF-8 text file and read its contents. A context manager closes the file automatically, even if reading fails.
file✓ Tested
Read a URL query parameter
Parse a URL with the standard JavaScript URL API.
JavaScript✓ Tested
Read a UTF-8 file
Read a small file as text using Node.js.
JavaScript✓ Tested