要開發一個專案的時候,都先用最簡單最熟悉的技術。這樣一來專案早點成形,也比較有成就感。
時間多的話,可以慢慢研想要使用的技術。
Category: Uncategorized
Understanding JavaScript Closures: A Simple Explanation
In JavaScript, a closure is a feature where an inner function has access to variables from an outer function even after the outer function has finished executing. This happens because the inner function ‘remembers’ the environment in which it was created.
Here’s a simple way to understand it:
- Outer Function: You have an outer function that defines some variables.
- Inner Function: Inside this outer function, you create an inner function. This inner function can use the variables defined in the outer function.
- Closure: Even after the outer function has finished executing and its scope is gone, the inner function still has access to those variables. This persistent access to the variables of the outer function is what we call a closure.
It’s like having a backpack. When you leave your house (the outer function), you take things (variables) with you in your backpack. Throughout the day (even after you’ve left your house), you can still use everything you put in your backpack. That backpack and its contents are your closure in the outside world.
效能相關學習
安裝.NET 8
好久沒玩打內了,來安裝一下打內八。
安裝網址:Download .NET (Linux, macOS, and Windows) (microsoft.com)
學習做RPG
有時候套件會擋到API請求
net::ERR_BLOCKED_BY_CLIENT
測試API的時候,只有Edge出現這個訊息,其它的瀏覽器不會
所以測試時要確保沒裝什麼會防礙到的套件
尤其是擋廣告的套件!千萬注意。
爆炸
Zod相關研究
Complete SQL Mastery
optioanl props
{...(isEditMode ? { onClick: () => handleClick(value) } : {})}