-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Closed
Description
Description
While reviewing the application.js file, I noticed that Express defines:
var slice = Array.prototype.slicebut later in app.listen, it still uses the full property access:
var args = Array.prototype.slice.call(arguments)This can be simplified to use the cached reference:
var args = slice.call(arguments)`Expected Behavior
Use the already-defined slice reference for consistency and to avoid repeating
Array.prototype.slice The behavior remains identical.
Actual Behavior
The code currently uses the direct prototype access instead of the cached reference.
Rationale
-
Improves consistency within the file
-
Avoids repeated long-form prototype access
-
Slight micro-optimization (cached function reference)
-
No behavioral changes
-
All tests continue to pass
Proposed Change
Replace:
var args = Array.prototype.slice.call(arguments)with:
var args = slice.call(arguments)I am happy to submit a pull request if maintainers consider this cleanup acceptable.
Metadata
Metadata
Assignees
Labels
No labels