Consider renaming shift
#103
Replies: 5 comments
-
I've seen this called But yeah barring some like highly-specific computer vision use case or similar, seems like more a leet code problem than anything. I could see maybe a method like |
Beta Was this translation helpful? Give feedback.
-
I think |
Beta Was this translation helpful? Give feedback.
-
I disagree that this is not an essential function. My recent personal use-case was iterating over polygon vertices from any starting vertex. But there are many more valid use-cases:
However I agree it should be renamed to |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Resolved by #156 |
Beta Was this translation helpful? Give feedback.
-
Since there's already
Array.prototype.shift
and both work with arrays, it's better to avoid reusing the name “shift”.What does Radashi
shift
do?When
n
is positive, it movesn
items from the end of an array to the front (preserving order). Whenn
is negative, it moves the frontn
items of an array to the end.Possible alternatives
Should it be removed entirely?
It's unclear how useful this function is, or if it deserves to be in Radashi. Any feedback on this is appreciated.
Beta Was this translation helpful? Give feedback.
All reactions