2019年7月14日 星期日

A javascript analog of python's range

var range=(a,b,c)=>
  {
    if(!b) b=1;
    if(!c) c=1;
    let arr=new Array(Math.floor(Math.abs(a-b)/c)+1).fill(0);
    arr=arr.map((i,ind)=>(ind*(b-a)/(arr.length-1)+a));
    return arr;
  };








1 則留言:

匿名 提到...

The King Casino Resort - Hertzaman
Find aprcasino the perfect gri-go.com place to herzamanindir.com/ stay, play, and https://octcasino.com/ unwind at Harrah's Resort Southern California. Get your points now! wooricasinos.info