[thelist] recursive JS function?

Ben Henick persist1 at io.com
Mon Feb 19 19:11:37 CST 2001


On Mon, 19 Feb 2001, Erik Mattheis wrote:

> PS - the purpose of this is to create variables for a hierarchical 
> menu system, and the links need to be sorted on multiple criteria at 
> once ... I've looked for examples of an array sorting function that 
> sorts on multiple criteria - both on the web and in my brain; can't 
> find anything in either place. Is that even possible in JavaScript?

You'd have to either use array.sort recursively, or define your criteria
from scratch and put them into an array of their own.

I do see nested 'for' loops in your future.  It's actually easier than it
probably appears.


-- 
Ben Henick
Web Author At-Large
http://www.io.com/persist1/
persist1 at io.com

"Are you pondering what I'm pondering, Pinky?"
"I think so, Brain, but... (snort) no, no, it's too stupid."
"We will disguise ourselves as a cow."
"Oh!" (giggles) "That was it exactly!"





More information about the thelist mailing list