RMRupert McKayinblog.rupertmckay.com·May 16, 2022 · 6 min readAsynchronous Programming in TypeScriptKey takeaways: Promises can run code after some other code has completed async/await is just syntactic sugar Promise.all is great for parallel tasks What is a Promise? A promise is some task that we can use to chain together later tasks. For exampl...01R
RMRupert McKayinblog.rupertmckay.com·Feb 28, 2022 · 6 min readWhat is Memoization?Imagine I asked you to calculate 23 times 47. And let's imagine you don't have a calculator or your phone on you, so you have to do it the hard way using just a pencil and paper. Your working might look something like this: 23 * 47 = 20 * 47 + 3 * 4...03RAR
RMRupert McKayinblog.rupertmckay.com·Jan 17, 2022 · 8 min readSorting in JavaScriptJavaScript arrays have a builtin sort method, which mostly does what you expect: [1, 4, 2, 3].sort(); // [1, 2, 3, 4] ["d", "a", "b", "c"].sort(); // ['a', 'b', 'c', 'd'] But it has some quirks. For examples numbers are sorting as though they were s...02ME
RMRupert McKayinblog.rupertmckay.com·Jan 3, 2022 · 10 min readWhat is a number?TL;DR: No datatype will ever be able to represent all numeric values perfectly Rounding errors will always exist JavaScript uses floating-point numbers which are sufficient for many use cases If this is not sufficient for your use case... JavaScript...04BECM
RMRupert McKayinblog.rupertmckay.com·Dec 4, 2021 · 6 min readReact Testing Library RecipesAs long as I've been working in frontend development, the tools available for testing UIs have felt clunky, hard to use, and not filled me with confidence that they reflect real end-user experiences. I was especially tired of libraries that directly ...01L