FIND YOUR NEXT FEW LINES

Results for “k”

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

1871 snippets foundClear filters
Arduino / CBinary values & packets

Toggle a bit with an XOR mask

Arduino / C: XOR flips selected bits and leaves all other bits unchanged.

Arduino / C✓ Tested
jQueryGetting Started

Toggle a CSS class with a click

jQuery: Learn how to toggle a CSS class with a click in a complete browser example.

jQuery✓ Tested
AngularLists & control flow

Track a selected record by its identifier

Track a selected record by its identifier with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularSignals & state

Track only dependencies used by a computed branch

Track only dependencies used by a computed branch with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactLists & filtering

Track selection by a stable identifier

Track selection by a stable identifier with a small React component and explicit browser behavior.

React✓ Tested
ReactForms & validation

Track whether a form differs from its initial value

Track whether a form differs from its initial value with a small React component and explicit browser behavior.

React✓ Tested
CStructures & function interfaces

Track which union member is currently valid

C: An explicit tag tells callers which overlaid union value to read.

C✓ Tested
JavaScriptText handling & Unicode

Transform each regex match with a callback

JavaScript: A replacement callback computes the replacement separately for each match.

JavaScript✓ Tested
TypeScriptText handling & Unicode

Transform each regex match with a callback

TypeScript: A replacement callback computes the replacement separately for each match.

TypeScript✓ Tested
JavaScriptText handling & Unicode

Trim and discard blank lines

JavaScript: Split a text block, trim each line, and keep nonempty values.

JavaScript✓ Tested
TypeScriptText handling & Unicode

Trim and discard blank lines

TypeScript: Split a text block, trim each line, and keep nonempty values.

TypeScript✓ Tested
GoConcurrency & cancellation

Try a channel receive without blocking

Try a channel receive without blocking using a complete Go program with explicit sample inputs.

Go✓ Tested