#14216 closed bug (notabug)
Bug in code of document "Type"
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.10.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
http://api.jquery.com/Types/#Array
x.sort() [ 1, 2, 3 ] x.splice( 1, 2 ) [ 2, 3 ] should be x.splice( 1, 2 ) [ 1 ]
Change History (5)
comment:1 follow-up: 2 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
comment:2 Changed 10 years ago by
Replying to rwaldron:
It's only a "typo" if you're expecting the current value of
x
, but that output is the return value ofx.splice( 1, 2 )
Am I misunderstand? The correct result is: [ 1, 2, 3 ].splice(1, 2) = [ 1 ] But the document means: [ 1, 2, 3 ].splice(1, 2) = [ 2, 3 ] ,which is wrong.
comment:4 follow-up: 5 Changed 10 years ago by
Thanks for the fiddle, but you're missing the point of what I said. You're expecting to see the current state of "x", but the documentation is showing the _return_ _value_ of splice. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice
comment:5 Changed 10 years ago by
Replying to rwaldron:
Thanks for the fiddle, but you're missing the point of what I said. You're expecting to see the current state of "x", but the documentation is showing the _return_ _value_ of splice. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice
Ok ok, I've understand at, finally :P But I'd wish the document to point out it, to reduce different meanings :)
It's only a "typo" if you're expecting the current value of
x
, but that output is the return value ofx.splice( 1, 2 )