wow😍. That's nice but please add a call to setTimeout with 300+ milliseconds before clicking the button otherwise LinkedIn will think you're running an automated tool and will block your account.
const buttons = document.querySelectorAll('button.artdeco-button--secondary');
buttons.forEach((button) => setTimeout(() => button.click(), 1000));