Andy Chang
Oct 21, 2022

--

感謝你的分享~

有個問題想請教一下

最後一個LastArrayElement的範例

為什麼不是直接解構last element前的array,如下:

ValueType extends [...infer _, infer Tail] ? Tail : never

而是使用遞迴去找出最後一個element的type,是有什麼特別的原因嗎?還是說我的想法是錯的呢~

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Andy Chang
Andy Chang

Written by Andy Chang

一點一滴進步的軟體工程師,努力讓今天的自己比昨天的更好

No responses yet

Write a response