Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 알고리즘
- 컴퓨터과학
- 문자열
- AWS
- 문자열처리
- CS
- 컴퓨터공학
- 철학
- lightsailor
- Hill Climbing
- Local Search
- 코드
- typescript
- node배포
- 파이썬
- Search Algorithm
- computerscience
- node.js
- Simulated Annealing
- multer-s3
- 배포
Archives
- Today
- Total
지식의모듈화
Axios get 본문
import axios from 'axios'
let object={};
while(Object.keys(object).length < 3){
try{
let res = await axios.get("https://api.kanye.rest")
// console.log(res.data)
object[res.data.quote]=(object[res.data.quote]||0)+1;
// console.log(res.data.quote)
}catch(error){console.log(error)};
}
console.log(Object.keys(object))
Axios를 활용하면 쉽게 get을 해올 수 있다. 서로 다른 3개의 kanye west의 명언을 fetch해오는 코드다
'Javascript' 카테고리의 다른 글
[javascript] for ~ in, for ~ of (0) | 2022.06.23 |
---|