Re: Create a string with (n) copies of the same character



In microsoft.public.scripting.jscript message <Xns99B261836715Feejj99@19
4.109.133.242>, Fri, 21 Sep 2007 07:35:10, Evertjan. <exjxw.hannivoort@i
nterxnl.net> posted:
what about:

L>>1

for

L/2

?

In itself it seems to be at least 3 times as fast:

Agreed, though that does limit the size of the string <g> ; but for
every L/2 there is a call to BigCat and a T + T, so it will make little
difference.

BTW, ISTM that using a while (n--) type of loop would reduce your
timing overhead.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
.



Relevant Pages

  • Re: Specifying a form by name? Problems with document.forms[x]
    ... You are a reliable source of bad advice, ... It's a good idea to read the newsgroup and its FAQ. ... jscr maths, dates, sources. ... TP/BP/Delphi/jscr/&c, FAQ items, links. ...
    (comp.lang.javascript)
  • Re: How does the break statement work?
    ... Where will control pass to once the break statement is executed? ... It's a good idea to read the newsgroup c.l.j and its FAQ. ... jscr maths, dates, sources. ... TP/BP/Delphi/jscr/&c, FAQ items, links. ...
    (comp.lang.javascript)
  • Re: Replace certain words on an entire page
    ... Tested briefly in IE6 js-quick only. ... It's a good idea to read the newsgroup c.l.j and its FAQ. ... jscr maths, dates, sources. ... TP/BP/Delphi/jscr/&c, FAQ items, links. ...
    (comp.lang.javascript)
  • Re: Dangerous quotes
    ... If the title is generated by JavaScript, you can escape the inner " with ... It's a good idea to read the newsgroup c.l.j and its FAQ. ... jscr maths, dates, sources. ... TP/BP/Delphi/jscr/&c, FAQ items, links. ...
    (uk.net.web.authoring)
  • Re: FAQ Topic - How do I detect Opera/Netscape/IE?
    ... to use is supported by the browser before using it. ... It's a good idea to read the newsgroup c.l.j and its old FAQ. ... jscr maths, dates, sources. ... TP/BP/Delphi/jscr/&c, FAQ items, links. ...
    (comp.lang.javascript)

Loading