foggy, 1 year ago <span style="color:#323232;">try { </span><span style="color:#323232;"> const joke = allProgrammingJokes[Math.floor(Math.random() * allProgrammingJokes.length)]; </span><span style="color:#323232;"> if (!getJoke(joke)) { </span><span style="color:#323232;"> throw new Error("Joke not understood"); </span><span style="color:#323232;"> } </span><span style="color:#323232;">} catch (error) { </span><span style="color:#323232;"> console.log("lol *upvotes*"); </span><span style="color:#323232;">} </span><span style="color:#323232;"> </span><span style="color:#323232;">function getJoke(joke) { </span><span style="color:#323232;"> // This function is intentionally flawed to always return false. </span><span style="color:#323232;"> // It's a part of the joke! </span><span style="color:#323232;"> return false; </span><span style="color:#323232;">} </span>
<span style="color:#323232;">try { </span><span style="color:#323232;"> const joke = allProgrammingJokes[Math.floor(Math.random() * allProgrammingJokes.length)]; </span><span style="color:#323232;"> if (!getJoke(joke)) { </span><span style="color:#323232;"> throw new Error("Joke not understood"); </span><span style="color:#323232;"> } </span><span style="color:#323232;">} catch (error) { </span><span style="color:#323232;"> console.log("lol *upvotes*"); </span><span style="color:#323232;">} </span><span style="color:#323232;"> </span><span style="color:#323232;">function getJoke(joke) { </span><span style="color:#323232;"> // This function is intentionally flawed to always return false. </span><span style="color:#323232;"> // It's a part of the joke! </span><span style="color:#323232;"> return false; </span><span style="color:#323232;">} </span>