FIND YOUR NEXT FEW LINES

Results for “k”

Small, practical examples. Search by task or narrow things down below.

1871 snippets foundClear filters
JavaScriptGetting Started

Require two conditions to be true

JavaScript: Combine a lower and an upper bound to check whether a value is in range.

JavaScript✓ Tested
TypeScriptGetting Started

Require two conditions to be true

TypeScript: Combine a lower and an upper bound to check whether a value is in range.

TypeScript✓ Tested
C++Getting Started

Require two conditions to be true

C++: Combine a lower and an upper bound to check whether a value is in range.

C++✓ Tested
CGetting Started

Require two conditions to be true

C: Combine a lower and an upper bound to check whether a value is in range.

C✓ Tested
ReactEffects & lifecycle

Rerun an effect when its dependency changes

Rerun an effect when its dependency changes with a small React component and explicit browser behavior.

React✓ Tested
HTMLImages & embedded documents

Reserve an image’s display dimensions

HTML: Width and height attributes supply a known display size and aspect ratio before decoding finishes.

HTML✓ Tested
AngularReactive forms

Reset a nonnullable control to its initial value

Reset a nonnullable control to its initial value with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularTemplate-driven forms

Reset a template-driven form

Reset a template-driven form with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactForms & validation

Reset controlled form state

Reset controlled form state with a small React component and explicit browser behavior.

React✓ Tested
ReactState & reducers

Reset reducer state explicitly

Reset reducer state explicitly with a small React component and explicit browser behavior.

React✓ Tested
GoHTTP & URLs

Resolve a relative URL

Resolve a relative URL using a complete Go program with explicit sample inputs.

Go✓ Tested
JavaScriptRegular expressions & URL encoding

Resolve a relative URL against a base

JavaScript: A trailing slash makes the final base path component a directory.

JavaScript✓ Tested