(arg) - JavaScript
argument and parameter positions
clojure
(arg pos? val?)Where:
Examples
Find zero-delay timers that can starve the main thread.
clojure
(call setTimeout (arg 2 (num 0)))Selects in lines { 1 } but not in { 2, 3 }:
typescript
setTimeout(tick, 0)
setTimeout(tick, 250)
setInterval(tick, 0)Identify request handlers when migrating server frameworks.
clojure
(fun _ (:and (arg 1 (id req)) (arg 2 (id res))))Selects in lines { 1, 2 } but not in { 3 }:
typescript
function handle(req, res) {}
const handleArrow = (req, res) => {}
function reversed(res, req) {}Find one-time event listeners that are safe to remove manually.
clojure
(call (mem addEventListener) (arg 3 (obj (prop once))))Selects in lines { 1 } but not in { 2, 3 }:
typescript
button.addEventListener("click", onClick, { once: true })
window.addEventListener("scroll", onScroll, { passive: true })
document.addEventListener("keydown", onKey)Arguments
pos
- Number
Does NOT support: Composition — Free-form Selection — Refinement — Replacement