Skip to content

Iterative writes #16

@lazarljubenovic

Description

@lazarljubenovic

Similarly to the reason conditionalWrite was introducted, it would be really nice if we were not forced to break the chain and introduce a for-of loop with a single writeLine call.

Something along the lines of the following would be great.

const indexes = [5, 9, 10, 15, 17]

writer
  .writeLine(`return [`)
  .iterateWriteLine(indexes, index => `this.array[${index}],`)
  .writeLine(`]`)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions