Tagged Questions
2
votes
1answer
32 views
Review a simple sprite sheet animation script
This is just a simple script for testing sprite sheet animations. I'm trying to improve my code style, so I'm curious about suggestions anyone might have about best practices or readability.
...
0
votes
0answers
40 views
How to create usefull loops? optimize numbers to words script
I wrote a code which makes real numbers verbal, and I'm trying to design short functions that will include any case in them, instead of mentioning specifc cases (which works here). You will get the ...
3
votes
1answer
88 views
Iterate through a LinkedList in a cleaner manner
I have a collection of PlaylistItem objects. They are linked together such that each item knows the ID of its next/previous item. I am iterating over this collection of objects, starting at a known ...
4
votes
1answer
72 views
Looping through Radgrid in JS is slow, can this be faster?
I do a single select in one radgrid, and based upon that selection I want to select multiple rows in a different radgrid:
<telerik:RadGrid ID="rgPaymentLines"> <ClientEvents ...
5
votes
4answers
263 views
Improve speed for looping through 1,000's of items in javascript?
This is a script I use to count how many items are selected in a form. Currently it loops through the entire form to count how many check boxes are selected, each time a checkbox is clicked. The form ...
1
vote
3answers
314 views
Optimize Array.indexOf
How can I optimize checking a value in recursion before operating on it? I'm using Array.indexOf (this is Javascript)
var nums = [], lengths = [];
function findNumLength(n) {
//preliminary check ...
1
vote
2answers
98 views
Refactoring 3 level depth for loops in JavaScript
I'm trying to get rid of some of the horrible nested loops in the following code.
Essentially is moving TDs to top rows based on whether the current row has the current cell. You can see the ...
2
votes
2answers
119 views
What do you think about this usage of for loop in JavaScript?
Algorithm that I had to write is a perfect case for while, or do..while loop, however I found out that if I will implement it with a for loop I will save few lines of code and also scope of variables ...