이게 된다....


안될 이유는 없다...


근대 되는게 또 신기하다...


한번에 많은 api 를 가지고 올수있겠다...


후.......


수정...

코드를 이렇게 고쳤다..


async function generate_stock_data() {
    await Promise.all([
        // api related to low(l) high(h) open(o) current(c)
        await fetch(`https://finnhub.io/api/v1/stock/profile2?symbol=AAPL&token=${STOCK_API_KEY}`)
        // company information
    ,   await fetch(`https://finnhub.io/api/v1/quote?symbol=AAPL&token=${STOCK_API_KEY}`)
    ])
    .then(async function (responses) {
        console.log("here");
        // return Promise.all(responses.map(function (response) {
        //     return response.json();
        // }));
        let resultJson = [];
        for (let i = 0i < responses.lengthi++) {
            resultJson[i= await responses[i].json();
        }
        
        return resultJson;
    }).then(data => {
        console.log(data);
    }).catch(error => console.log(error));
}


예상되로 잘 돌아간다....

루프 사용하면 코드가 더 깔끔해진다...


후......