12th weekly post, empty string is everywhere. Also, AWS Lambda goes Arm.
Items of the week
- JavaScript —
anyString.includes('')
returningtrue
might seem absurd but the behaviour matchesanyString.substring(0, 0)
returning''
andanyString.indexOf('')
returning0
. Be careful when attempting something likeprovidedString.includes(searchString)
. More on the method on MDN Web Docs. - TypeScript — JSX is the reason we can type cast using the
as
operator (HTMLElement as HTMLInputElement
) in addition to using angle brackets (<HTMLInputElement> HTMLElement
) which will be difficult to parse when mixed with JSX HTML-like syntax, as stated on TypeScript official documentation page. - AWS — Lambda functions can now run on the Arm-based Graviton2 processors by specifying arm64 as the architecture. It is said to be able to provide up to 34% price performance improvement. Details are available on the official AWS blog page.
Note of the week
On the week 39 of 2021, I learned that the Kindle’s Vocabulary Builder feature not only automatically add words as flash cards, but also show the usage of a word in the book. Having that usage context might have encouraged me to use the feature more but I wish I could’ve discovered it couple of years earlier. That’s all for this post, thank you for reading and if you have got any feedback, do let me know by leaving a comment. Have a nice day!