01 2019 档案
摘要:需求一 假设有一个数组,需要对其中的元素进行求和。 传统写法,使用for循环求和 使用reduce求和 reduce()函数的第一个参数是一个callback function,这个function中有2个参数,accumulator相当于sum,currentValue 是当前循环中数组的元素值。
阅读全文
摘要:```js import { Component, OnInit } from '@angular/core';
import { Router} from '@angular/router';
import { Location } from '@angular/common'; @Component({ selector: 'app-notfound', templateUrl: ...
阅读全文