thaycacac
I hereby claim:
- I am thaycacac on github.
- I am thaycacac (https://keybase.io/thaycacac) on keybase.
- I have a public key ASDeGPdl9vdaj5m2wykedNEpLjWyizbW5xpJk7VCotpBRAo
To claim this, I am signing this object:
thaycacac
I hereby claim:
To claim this, I am signing this object:
| function createElement(type, props, ...children) { | |
| return { | |
| type, | |
| props: { | |
| ...props, | |
| children: children.map(child => | |
| typeof child === "object" ? child : createTextElement(child) | |
| ) | |
| } | |
| }; |
| import axios from 'axios' | |
| const baseDomain = 'https://example.com' | |
| const baseUrl = `${baseDomain}/api/v1` | |
| export default axios.create({ | |
| baseUrl, | |
| header: { "Authorization": "Bearer yourToken" } | |
| }) |
| .grid { | |
| width: 100%; | |
| display: block; | |
| padding: 0; | |
| } | |
| .grid.wide { | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| } |
| const fetchData = async () => { | |
| const res = await fetch("https://restcountries.eu/rest/v2/alpha/col"); // fetch() returns a promise, so we need to wait for it | |
| const country = await res.json(); // res is now only an HTTP response, so we need to call res.json() | |
| console.log(country); // Columbia's data will be logged to the dev console | |
| }; | |
| fetchData(); |
| var jsonData = JSON.parse(responseBody); | |
| postman.setEnvironmentVariable("token", jsonData.data.token); |
| // Phone number | |
| const re = /((09|03|07|08|05)+([0-9]{8})\b)/g |
| <template> | |
| <div class="container"> | |
| <header class="header"> | |
| <el-row :gutter="30"> | |
| <el-col :sm="24" :md="24" :lg="14" class="header__left"> | |
| <h1 class="header__left__title"> | |
| Học lập trình | |
| <span class="header__left__title--blue">Ngay từ ngày hôm nay</span> | |
| </h1> |
Tính tổng và tích của array sử dụng reduce javascript
function accumulation(...array) {
return array.reduce((prev, next) => prev + next, 0);
}
function multiplication(...array) {
return array.reduce((pre, next) => pre * next, 1);
}| // callback hell | |
| const eat = food => console.log(food) | |
| const collectOrder = (order, cb) => { | |
| console.log(order) | |
| cb("eat rice") | |
| } | |
| const placeOrder = (toppings, cb) => { |