编译失败 我正在尝试运行一个货币转换器应用程序,但是当我尝试从API获取响应时,我一直得到此提示
./ src / Components / currencyconvert.js
Line 25:22: Parsing error: Unexpected token
23 | const currencyAr = ["EUR"]
24 | for (const key in response.data.rates){
> 25 | currencyAr.push.(key);
| ^
26 | }
27 | this.setstate({currency: currencyAr });
28 | })
答案 0 :(得分:1)
简单删除点。
currencyAr.push.(key);
应该是
currencyAr.push(key);