3 ms·
Binding a function to a variable does not make it less reusable. Just like binding other values like numeric constants, strings or objects to variables makes th
by VMG 13y ago
Binding a function to a variable does not make it less reusable. Just like binding other values like numeric constants, strings or objects to variables makes them less reusable.
Binding functions to variables however does highlight the fact that functions are first-class values in JavaScript and can be locally scoped, passed to other functions and can be operated on. Functions in Javascript are not the same as functions C or Java and don't need to pretend to be similar.
If you want to prevent a function binding to be changed, use es6's const and don't pretend that function declarations helps you with that.