type Fkk = {
userId: number;
}
const getMyData = async (): Promise<Fkk> => {
const response = await fetch("url", {
// ....
})
if (response.status > 200 || response.status < 200) {
throw new HttpError("response code is not in 200-299 range", response)
}
return await response.json()
}
const req = http.request(
"...",
{ method: "GET", headers: { "Content-Type": "application/json", "Content-Length": body.length } },
res => res.on("data", v => console.log(`response from request callback ${v}`)),
);
req.on("response", v => v.on("data", v => console.log(`response from req.response ${v}`)));
const v = ["product1", "products2"]
const v2 = ["product3", "products4"]
console.log([...v, ...v2])
/// ['product1', 'products2', 'product3', 'products4']