Skip to content

typescript operator '+=' cannot be applied to types Number and Number #3447

@Akxe

Description

@Akxe

Why?

ref: [
  {
    value: Number
    date?: Date
  }
]
total() {
  var total = 0
  for (var ind = this.ref.length - 1; ind >= 0; ind--) {
    total += this.ref[ind].value
  }
  return total
}

This is totaly vaild in JS, should be in typescript too

Metadata

Metadata

Assignees

No one assigned

    Labels

    By DesignDeprecated - use "Working as Intended" or "Design Limitation" insteadCanonicalThis issue contains a lengthy and complete description of a particular problem, solution, or design

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions