JavaScript Suppresses Every Error
'use strict' /** * Tries to execute a function and discards any error that occurs. * @param {Function} fn - Function that might or might not throw an error. * @returns {?*} Return-value of the function when no error occurred. */ module.exports = function(fn) { try { return fn() } catch (e) {} }
A screenshot of JavaScript code that executes a function inside a try-catch block and silently discards any error. The joke is that this is an exaggerated example of JavaScript earning its reputation by swallowing errors instead of handling them visibly, making it a reaction to buggy or questionable JS code. EN: A screenshot of JavaScript code that executes a function inside a try-catch block and silently discards any error. The joke is that this is an exaggerated example of JavaScript earning its reputation by swallowing errors instead of handling them visibly, making it a reaction to buggy or questionable JS code.
code editor screenshot / скриншот редактора кодаJavaScript code / код JavaScriptfunction / функцияtry-catch block / блок try-catcherror handling / обработка ошибокtext lines / строки текстаprogramming comments / комментарии в кодеsyntax highlighting / подсветка синтаксисаwhite background / белый фон
- @ithueti / 1167 2019-08-18
- Type
- image
- Size
- 800×397 · 33.1 KiB
- Mood
- саркастичный, абсурдный
- Language
- en
- Added