Skip to content

Save start, stop, and step as properties of range #59

@parzhitsky

Description

@parzhitsky

In case of numeric implementation, save start, stop, and step as properties of range:

const { start, stop, step } = xrange(10);

start; // 0
stop; // 10
step; // 1
const { start, stop, step } = xrange(2, -3);

start; // 2
stop; // -3
step; // -1
const { start, stop, step } = xrange(42, 17, 5);

start; // 17
stop; // 42
step; // 5
const range = xrange(7, () => true, Math.random);
const { start, stop, step } = range;

start; // undefined
stop; // undefined
step; // undefined

"stop" in range; // true
"step" in range; // true

Metadata

Metadata

Assignees

No one assigned

    Labels

    Change: minor[Issue / PR] describes a non-breaking change, such as adding a new functionalityDomain: main[Issue / PR] describes change in the functionality, its optimizationPending: blocked[Issue / PR] cannot be addressed until another issue is resolvedPriority: medium[Issue / PR] should be addressed without delayType: improvement[Issue / PR] addresses lack of a functionality or an open possibility of enhancementgood first issue[Issue] can be addressed by a first-time contributor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions