const getDesc = searchKey => {
return new Promise(resolve => {
fetch('http://localhost/?apiKey=123&parm='${searchKey}')
.then(res => res.json)
.then(json => resolve(json))
});
}
let arr = ["aa", "bb", "cc"];
//forEach 사용말것,
//순서대로
const descProc = async () => {
for(let data of arr){
let desc = await getDesc("tb_table");
console.log(data, desc);
}
}
'web > javascript' 카테고리의 다른 글
| fetch (0) | 2026.01.14 |
|---|---|
| callBack - for (0) | 2026.01.14 |
| callBack - fetch (0) | 2026.01.14 |
| callBack - Reject (0) | 2026.01.13 |
| callBack - errFunc (0) | 2026.01.13 |