Skip to content

Instantly share code, notes, and snippets.

View shaggybb's full-sized avatar

Ivan Rubio shaggybb

  • Xing
  • Barcelona, Spain
View GitHub Profile
@shaggybb
shaggybb / unhandled-exceptions.js
Created January 28, 2018 16:18 — forked from ericelliott/unhandled-exceptions.js
Capturing Unhandled Exceptions
window.onerror = function(message, file, line, column, error) {
error = error || {};
$.ajax({
method: 'POST',
url: 'https://yourapp.com/path/to/error/log',
data: JSON.stringify({
message: message,
file: file,
line: line,
column: column,
@shaggybb
shaggybb / 1.scopes.js
Created January 24, 2020 08:59 — forked from marciobarrios/1.scopes.js
Practical frontend interview
(function() {
var a = b = 5;
})();
console.log(b);
// 1. What will be printed on the console?
// 2. Rewrite the code to return the same result but with the variable declarations separated
// 3. Enable strict mode to explicitly reference the scope