JavaScript

Language features, patterns, and runtime behavior

How-to guides

Array reduce: sum values and transform objects
Array.reduce() iterates an array and accumulates a single result.
arraysreducefunctionaltransform
Insert text at the selection in ProseMirror without breaking select-all or image selections
To put text where the user's selection is from code (dictation, snippets, autocomplete), call tr.insertText(text) with no positions, and give block selections a textblock first.
prosemirrortiptaptransactionsselectionundo