Array.from() to spread syntax

This commit is contained in:
djmaze 2020-09-22 10:13:32 +02:00
parent 07b002a66a
commit df1d0fc8d6
6 changed files with 27 additions and 7 deletions

View file

@ -67,7 +67,7 @@ window.BSN = (() => {
self.show = () => {
menu = parent.querySelector('.dropdown-menu');
menuItems = [];
Array.from(menu.children).forEach(child => {
[...menu.children].forEach(child => {
child.children.length && (child.children[0].tagName === 'A' && menuItems.push(child.children[0]));
child.tagName === 'A' && menuItems.push(child);
});