它的JavaScript阵列功能变异? [英] Which JavaScript Array functions are mutating?
问题描述
我写在JavaScript中的Array派生类,并且需要知道重载哪些功能,这样我可以知道到数组所做的更改。
I am writing an Array-derived class in JavaScript and need to know which functions to overload so that I can be aware of changes made to the array.
我知道的Array.push()
和方法Array.splice()
的变异。是否有任何其他的定义列表?
I know Array.push()
and Array.splice()
are mutating. Is there a definitive list of any others?
推荐答案
您可以找到MDN列表为<一个href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype#Mutator_methods\">Mutator方法(连同<一个href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype#Accessor_methods\">Accessor和<一个href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype#Iteration_methods\">Iteration方法):
You can find the list on MDN as Mutator methods (along with Accessor and Iteration methods):
- <$c$c>pop$c$c>
- <$c$c>push$c$c>
- <$c$c>reverse$c$c>
- <$c$c>shift$c$c>
- <$c$c>sort$c$c>
- <$c$c>splice$c$c>
- <$c$c>unshift$c$c>
这篇关于它的JavaScript阵列功能变异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!