fix: remove extra "slice()" call

This commit is contained in:
Oleksiy Kachynskyy 2020-03-20 14:54:33 +02:00
parent 9d7249e4bc
commit 26d3c7c274

View File

@ -58,7 +58,7 @@ class Json extends React.PureComponent<JsonProps> {
collapseAll = () => { collapseAll = () => {
const elements = this.node.getElementsByClassName('collapsible'); const elements = this.node.getElementsByClassName('collapsible');
// skip first item to avoid collapsing whole object/array // skip first item to avoid collapsing whole object/array
const elementsArr = Array.prototype.slice.call(elements).slice(1); const elementsArr = Array.prototype.slice.call(elements, 1);
for (const expanded of elementsArr) { for (const expanded of elementsArr) {
(expanded.parentNode as Element)!.classList.add('collapsed'); (expanded.parentNode as Element)!.classList.add('collapsed');