Пример взят из MDN webdocs
var paragraph = 'The quick brown fox jumps over the lazy dog. It barked.';
var regex = /[A-Z]/g;
var found = paragraph.match(regex);
console.log(found); // will return an array of matches and returns null when nothing matches.
Хотелось бы узнать причины возврата null вместо пустого массива, когда ничего не найдено?