Use IIFE
const parsedJSON = (() => { try { return JSON.parse(badJSON); } catch (error) { return {}; } })();