Open ldhbenecia opened 10 months ago
fetch("url").then((response) => { return response.json(); }).them((result) => { // (parameter) result: any }); const result = JSON.parse('{"hello":"json"'); // const result: any
fetch("url").then<{ data: string }>((response) => { return response.json(); }).them((result) => { // (parameter) result: { data: string; } }); const result: { hello: string } = JSON.parse('{"hello":"json"');
두 구문 모두 밑의
const result: { hello: string } = JSON.parse('{"hello":"json"}');
중괄호가 누락된 것 같습니다.
앗 감사합니다!
두 구문 모두 밑의
중괄호가 누락된 것 같습니다.