Вы можете использовать следующее для отладки, а также для ошибки, используя консоль
console.log Black color text with no icon
console.info Blue color text with icon
console.debug Pure black color text
console.warn Yellow color text with icon
console.error Red Color text with icon
console.error() method writes an error message to the console.
console.info() method outputs an informational message to the console
console.warn() method outputs a warning message to the console
Для получения дополнительной информации перейдите по ссылке