1fetch('https://momentjs.com/downloads/moment.min.js')
2 .then(response => response.text())
3 .then(text => eval(text))
4
1//What you can do is hook the console.log function so that you store when it logs :
2console.stdlog = console.log.bind(console);
3console.logs = [];
4console.log = function(){
5 console.logs.push(Array.from(arguments));
6 console.stdlog.apply(console, arguments);
7}
1console.log('log-message'); // Outputs a normal information log to the console window
2console.warn('warn-message'); // Outputs warning in the console window
3console.error('error-message'); // Outputs error in the console window
4console.table('table-message'); // Outputs a table of all the object properties