Transform Text with JavaScript: JavaScriptCore, input=$text(string), output=string(sync), no async/DOM/modules/network Run JavaScript on Web Page: JavaScriptCore+DOM, document available, scraping/extraction
Replaces 5+ native actions: text transforms, JSON navigation, array ops, date calc, conditionals Use when: >5 actions needed, heavy iteration, JSON restructuring, multi-step math Avoid when: <3 actions, non-coders maintain, app integrations, debugging critical
Constraints: no async/await/Promise/setTimeout/fetch/require/fs, string I/O only (parse/stringify), opaque errors, try-catch required