這個章節將會介紹到,在 ES6 新增的箭頭函式使用方法,因為在撰寫 React 程式時,已經都是使用 ES6 的模式再撰寫,所以,對於如何了解箭頭函式使用方法的是很重要的,接著就讓我們介紹它的特性及使用方法。
一句話簡單清楚的說,箭頭函式 (Arrow Function) 它是一種函式精簡的寫法。箭頭函式的基本語法如下:
這篇文章,前半部會介紹一些 Array 常用的基本方法,下面列的方法是目前本人在實際專案時,有運用到的方法,因此各別再去了解,這些方法背後的做的意義。
下半部會列出本人目前在實際專案時,公司所提出的需求,哪針對這個需求,又是如何使用下列 Array 所提供的方法來解決。
解構與字串模組都是 ES6 新增加的特性,也是在撰寫 React 專案時,很常會使用到的語法,接下來就會針對解構 & 字串模組來說明如何使用。
在這裡將以很常見的陣列來講解解構和 rest 參數語法的基本應用,下面是幾個範例說明。
Git 是什麼!? 在這篇文章中,並不會去特別介紹,至於想知道它的運作原理,可以去參考五倍紅寶石創辦人高見龍先生所撰寫一書,請連結如下。
[ES6] var、let、const 學習心得
前言
此篇文章是要介紹,在學習 React 之前,一定要知道的 JavaScript ES6 語法 (之後會簡稱為 JS or ES6),這是因為在撰寫 React 時,一定都是在撰寫 JS 程式碼,像筆者很習慣地寫 jQuery 程式碼,在 React 就幾乎派不上用場,而且整個團隊的開發也已講好,也一定會以 ES6…
接下來這篇是關於很基本的運算子做一點心得分享,也只會挑幾個需要特別的來說明。另外,最重要的是控制語法 (迴圈),這在任何一種程式語言,必定都會有的,只是各個程式語言在名稱稍微有點差異這樣。哪….最後如果有寫錯或是語意不清,再請各位不吝惜指教,謝謝。
從前面幾篇講到 ES6 完之後,原本預計是要寫跟 React 有關的,但是…後來想到公司的主管在一個月前問我,在學習 React 之前,我反而希望你去找一本書或一堂線上課程,把 JavaScript (後面簡稱 JS) 的基礎打好,然後你要多久完成這件事 !? 因此,我會利用這 3 月初到 4 月中的時間,把 JS 的基礎看過及用手去寫過,徹徹底底的把底子打好,也請各位如有寫錯的部份,也請不吝惜指教,謝謝。
[React Hooks 學習筆記] useState、useEffect
這篇文章將會介紹 React Hooks,Hook 是 React 16.8 中增加的新功能。它讓我們不必寫 class Component 就能使用 state 以及其他 React 的功能。
這個情境是指,當我們開發一個專案時,程式碼愈寫愈多,整個應用程式的規模愈來愈大時,那又如果我們都把全部的 JS 程式碼都集中在一個檔案時,會造成維護及閱讀上的困難,這樣的狀況是很糟糕的。
好在 ES6 開始支援模組,使得標準的 JavaScript 也可以使用這個功能,接下來就會針對 Import 與 Export 的語法來說明如何使用。
Web 應用程式佔客戶端 JavaScript 的比重越來越高,增加了使用 JavaScript 開發大型程式的機會。這意味者,開發者不能只是寫完程式就覺得:『好了,完成了!』伴隨開發完成而來的,是應用程式運作中將出現的錯誤修正、功能新增 / 更新等常態性的變更。
再變更程式時,首要任務就是『了解程式!』此時『閱讀』程式,可能比『寫』程式還更花時間:經過一段時間後,回頭再看自己寫的程式,可能都需要花時間回想,若是看他人的程式,當然需要…