Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Iterate over the specified range within the array, replacing each element with the given value. Normalize negative start/end indices by adding the array length, and clamp bounds to prevent out-of-range writes. The operation modifies the array in place and returns it.
Negative index normalization and bounds clamping ensure the fill range is valid, while in-place mutation avoids allocating a new array.
Updated Feb 2026