Arrow functions vs. traditional functions in JavaScript

Поделиться
HTML-код
  • Опубликовано: 25 ноя 2024

Комментарии • 2

  • @davidluhr
    @davidluhr Год назад +2

    Great points. I've found myself having similar conventions. Readability is better with traditional functions on their own, and arrow functions with array methods. `.forEach((item) => {` mentally read better as "for each item" compared to `.forEach(function (item) {` as "for each function item".