ZSZach Snoekinzachsnoek.hashnode.dev·Jun 25, 2022 · 3 min readJavaScript Quirks, Vol. 1: The typeof operatorJavaScript is a language full of wonderful quirks. In this post, I want to explore a few quirks about the typeof operator. The typeof operator As a reminder, JavaScript has eight types: Undefined Null Boolean String Number BigInt Symbol Object Java...00
ZSZach Snoekinzachsnoek.hashnode.dev·May 3, 2022 · 6 min readUnderstanding Symbols in JavaScriptWhat are symbols? Symbols are primitive values that are guaranteed to be unique. You can create a new symbol with the Symbol constructor and optionally provide a description string: const foo = Symbol('foo'); Symbols are primitives, not objects. We ...04DTDA
ZSZach Snoekinzachsnoek.hashnode.dev·Apr 9, 2022 · 3 min readWhen to use logical OR vs. nullish coalescing in JavaScriptIntroduction It’s common to use the logical OR operator (||) to specify a default value: function createSong(title, artist) { return { title: title || '(Untitled)', artist: artist || '(Unknown)', } } ES2020 adds the nullish c...01
ZSZach Snoekinzachsnoek.hashnode.dev·Mar 26, 2022 · 6 min readUnderstanding tagged template literals in JavaScriptIntroduction You’ve probably come across template literals when writing JavaScript: function sayHi(name) { console.log(`Hi, ${name}!`); } sayHi("Zach"); // "Hi, Zach!" Template literals are handy for their ability to interpolate values and crea...01V
ZSZach Snoekinzachsnoek.hashnode.dev·Jan 13, 2022 · 5 min readReturning null from Task-returning methods in C#Introduction Take a look at the following code and guess what happens when the Main method gets invoked: public class Program { public static async Task Main() { var result = await AsyncFoo(); result = await NonAsyncFoo(); ...00