Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #34268

Arrray fill vs looping thru.

Newsgroups comp.lang.javascript
Date 2017-11-04 04:11 -0700
Message-ID <a9115f4e-8686-427f-8a27-d98f4bebd0cc@googlegroups.com> (permalink)
Subject Arrray fill vs looping thru.
From jonas.thornvall@gmail.com

Show all headers | View raw


Could i use array fill instead of loop thru filling up values but how would i set offset?

offset=0;
for (var i=0;i<numberofvalues){
dval.Array(countval[i]).fill(i);
offset=offset+countval[i];
}

But i do not understand can i set an offset with fill, so as you see i never use it above. 

***HOW DO I MAKE THE FILL AT THE START ENTRY USING OFFSET***?
Is the fill function faster then using loop thru, i save a loop?

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Arrray fill vs looping thru. jonas.thornvall@gmail.com - 2017-11-04 04:11 -0700
  Re: Arrray fill vs looping thru. jonas.thornvall@gmail.com - 2017-11-04 04:20 -0700
    Re: Arrray fill vs looping thru. jonas.thornvall@gmail.com - 2017-11-04 04:29 -0700
      Re: Arrray fill vs looping thru. JJ <jj4public@vfemail.net> - 2017-11-04 18:53 +0700
  Re: Arrray fill vs looping thru. jonas.thornvall@gmail.com - 2017-11-04 05:06 -0700
    Re: Arrray fill vs looping thru. jonas.thornvall@gmail.com - 2017-11-04 05:24 -0700

csiph-web