not every function is callable, for example, Map is a function, but calling it with Map()
throws a TypeErrorโ
not every function is constructable, for example, Symbol is a function, but calling it with new Symbol()
throws a TypeErrorโ
// Array is callable & constructable, same effect.
let arr1 = Array(3);
let arr2 = new Array(3);
let map = Map(); // Map is not callable.
// ^^^
// โ TypeError: Constructor `Map` requires 'new'
let sym = new Symbol(); // Symbol is not constructable.
// ^^^
// โ TypeError: `Symbol` is not a constructor
arr1, // [ , , ] (3 empthy items)
arr2, // [ , , ] (3 empthy items)
Map instanceof Function, // true
Symbol instanceof Function, // true