A small gotcha with Array.fill() in JavaScript
Array.fill() is pretty useful when you need to create an array with some default values. For example: const numbers = Array ( 5 ). fill ( 0 ); console . log ( numbers ); // 0, 0, 0, 0, 0 Nothing unusual there. But things get a bit confusing when you use it with objects.