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


Groups > comp.lang.javascript > #18719

can I rewrite this replace to use only one loop

From "Tony" <tony.johansson@inport.com>
Newsgroups comp.lang.javascript
Subject can I rewrite this replace to use only one loop
Date 2013-03-05 12:37 +0100
Organization A noiseless patient Spider
Message-ID <kh4lbt$3bg$1@dont-email.me> (permalink)

Show all headers | View raw


In this for loop I loop through the array and replace - with /
var bytUt = /-/g;
            for (i = 0; i < tempArray.length; i++)
            {
                tempArray[i].ETATime = tempArray[i].ETATime.replace(bytUt, 
"/");
            }

In this for loop I loop through the array and replace T with " "
            var bytUt = /T/g;
            for (i = 0; i < tempArray.length; i++)
            {
                tempArray[i].ETATime = tempArray[i].ETATime.replace(bytUt, " 
");
            }

This works but can I replace this to a single for loop ?

//Tony 

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


Thread

can I rewrite this replace to use only one loop "Tony" <tony.johansson@inport.com> - 2013-03-05 12:37 +0100
  Re: can I rewrite this replace to use only one loop "Tony" <tony.johansson@inport.com> - 2013-03-05 12:46 +0100
  Re: can I rewrite this replace to use only one loop SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2013-03-05 14:31 +0100

csiph-web