Can you find the bug and explain why TypeScript isn’t catching it? Go!

Estimated read time 1 min read

Post Content

​ Hey friends, it’s TypeScript challenge time! This generic function should return the last item of any array. It looks simple, but something’s not working as expected here. Can you find the bug AND explain why TypeScript isn’t catching it? Bonus points if you can propose a fix that makes it completely type-safe! Share your skills in the comments!

Subscribe to Google for Developers → https://goo.gle/developers

Speakers: M.E. Francis   Read More Google for Developers 

You May Also Like

More From Author