左辺にもブレスを書いて配列展開できる
[es6]
var arr = [1,2,3];
const dùng để khai báo một hằng số - là một giá trị không thay đổi được trong suốt quá trình chạy. | |
const A = 5; | |
A = 10; // Lỗi Uncaught TypeError: Assignment to constant variable | |
let tạo ra một biến chỉ có thể truy cập được trong block bao quanh nó, khác với var - tạo ra một biến có phạm vi truy cập xuyên suốt function chứa nó. | |
function foo() { | |
let x = 10; | |
if (true) { |
// class | |
class Hamburger { | |
constructor() { | |
// This is the constructor. | |
} | |
listToppings() { | |
// This is a method. | |
} | |
} |
http://coenraets.org/present/es6 |
Comment.defaultProps = { | |
valueInput: '' | |
} | |
Comments.propTypes = { | |
addComment: PropTypes.func.isRequired, | |
comments: PropTypes.array.isRequired, | |
changeText: PropTypes.func.isRequired | |
} |
https://www.youtube.com/watch?v=UB1O30fR-EE&list=PLillGF-RfqbYeckUaD1z6nviTp31GLTH8 |
This gist is no longer in use.
/* This API wrapper is useful because it: | |
1. Centralizes our Axios default configuration. | |
2. Abstracts away the logic for determining the baseURL. | |
3. Provides a clear, easily consumable list of JavaScript functions | |
for interacting with the API. This keeps API calls short and consistent. | |
*/ | |
import axios from 'axios'; | |
let api = null; |
# GET VERSION | |
yarn -v (or --version) | |
# GET HELP | |
yarn help | |
# CREATE PACKAGE.JSON | |
yarn init | |
yarn init -y // Use defaults |