摘要: 1、教程中的 new HeroService(<any> httpClientSpy); 在实际项目中报错,说写法被禁止(forbidden),研究了半天,原来是要写成 new HttpService(httpClientSpy as any); 2、在使用HttpClient封装cervice后, 阅读全文
posted @ 2020-03-02 15:10 冰凝^ 阅读(149) 评论(0) 推荐(0) 编辑
摘要: reduce 数组通过此方法,可以实现将每一项叠加称为一项。 使用:sum = arr.reduce(fun, start); 其中,fun为一个方法,接收四个参数,分别为 pre:初始值或者上一次叠加(计算)结果值 cur:当前项的值 index:当前项的index arr:原数组 其中,star 阅读全文
posted @ 2020-03-02 11:26 冰凝^ 阅读(813) 评论(0) 推荐(0) 编辑