Destructuring assignment

const name = 'cute';
const surname = 'luna';

var sayHello = function({ name, surname }) {
  var cute = 'fuck you'; 
  var fuck = 'fuck your dick';
  console.log(`Hello ${name} ${surname}! How are you?`);
  console.log({cute});
  console.log({cute:fuck});
};

sayHello({ name: 'John', surname: 'Smith' });
sayHello({ name, surname });

可以把上面直接貼在console,或是貼到babel玩玩

React Life Cycle

constructors

Do
  • create any fields (variables starting with this.)
  • initialize state based on props received
  • set initial state
  • if not using class properties syntax — prepare all class fields and bind functions that will be passed as callbacks
Don’t
  • cause any side effects (AJAX calls etc.)

 

前端技術:前端相關Youtube頻道

The Net Ninja

還不錯,教程都還蠻新的,還有一個還沒播完的剛好是我很有興趣的(React, Redux & Firebase App Tutorial #1 – Introduction)不過就是腔調上有點聽不太慣。
有React、Vue、Node.js、REST API 、GraphQL的教學,而且都蠻新的。

 

Traversy Media

教學很多元!Vue、Angular、Node.js、MongoDB、Docker、MERN、Laravel…
還有很新的教學,我也很有興趣(Lyric Search App With React & Context API)

 

LearnCode.academy

 

 

Code Realm

影片都還蠻新的,有React.js、ES6的教學,竟然還有GraphQL


Mostly a front-end dev out of Montreal, QC seeking to spread love and knowledge out there. Interested in JS, React, NodeJS, or NoSQL? Then we might have a few things in common 😉

 

Programming with Mosh

這個光頭仔的聲音還蠻好聽的,發音也好懂,音質也好。

 

Codemy School

影片有點舊了。有React.js教學、Rails API、Git、Docker
覺得git branch的教學還不錯

JavaScript Closure Sample

閉包的解釋:
1. 外面讀不到裡面,裡面讀得到外面
2. 每個函式可以有自己的私有變數,跟其它的函式名子可以一樣(會有容易搞混的缺點
3. 閉包:它本來抓得到什麼值,就能抓到什麼值,不論它是在哪裡執行的(可能return 給外層的函式了)

參考文章:
A Simple Explanation of JavaScript Closures
⭐️⭐️⭐️⭐️⭐️
超推薦,簡單好懂,排版也好看
How to explain JavaScript Closure to a 5 years old kid
⭐️⭐️⭐️⭐️⭐️
這篇也超好懂的啦
Javascript Closure tutorial ( Closures Explained )
這篇講得比較多些