Coder Social home page Coder Social logo

range's Introduction

range

Pythonic way of using Range function implemented in TypeScript. Cause- why not?

Implementation

  • Format :
// Required argument
range(limit);

// Optional arguments
range(start, limit, step);

// start count is by default : 0;
// step count is by default : 1. i.e, unit iteration.
  • Start: The start of the count. By default it is set to 0. To override the preset value pass an integer. (Inclusive).

  • Limit: The maximum you would want to count. This is a required argument. The Limit argument is (Exclusive) i.e, range(3) will count from 0 to 2 - that is 3 indices : 0, 1, 2. Zero is preset start count.Check the In Use section to know how to override the preset values.

  • Step: The count of iteration. By default set to 1

Installation

  • Using npm

    npm i python-ranger

//commonjs
const range = require("python-ranger");

//modules
import range from "python-ranger";

In Use

for (i of range(3)) {
  console.log(i);
}
// 0, 1, 2
for (i of range(4, 8)) {
  console.log(i);
}
// 4, 5, 6, 7
for (i of range(4, 12, 2)) {
  console.log(i);
}
// 4, 6, 8, 10

Report feedbacks, complaints, feature requests... ๐Ÿ“ฉ

  • Reach out to me via twitter/linkedin (socials linked with Github)
  • Or raise an issue for feature request or updates.

range's People

Contributors

dtech-dbug avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.