This guy ( Ayushv ) knows his JavaScript – you might want to check out his “medium” based blog posts on the subject.
https://ayushv.medium.com/
Functions are “high order” – are javascript objects – and can be passed as parameters “Fat Arrow Functions” easily allow
Choose Apple menu > System Settings, click Accessibility in the sidebar, then click Zoom on the right. (You may need