How to log errors thrown by assert.throws in the following JavaScript example:
const assert = require('assert').strict;
'use strict';
const i = 0;
assert.throws(
() => { i = i + 1 },
{
name: 'TypeError',
message: 'Assignment to constant variable.',
}
);