>>1
Trivial. I shouldn't tell you about it because it's your job to find out, but let's see if an example can get you on the right track for your programming course. Google for "direct insert sort" or "bubble sort", which are trivial sorting algorithms.
>>3
FYI, JavaScript is a programming language, and this sorting lists business is universal. You'll fail at programming anything if you can't do this. Please don't produce crappy JavaScript by copypasting "snippets" crap, and don't think you're "programming" by pressing Ctrl+V.
And FYI, JavaScript is a more advanced language than Java in many ways (built-in lists, built-in dictionaries, dynamic typing and binding, first class functions and methods, functions are closures, anonymous closures, easily extensible and more reflexive). It's just that its builtin library is inexistent, and it has mostly different uses.