// Sebesta problem 4-6 // Problem 4.6 - assume words are separated by exactly one blank function prob46() { var line = prompt('enter a line of text',''); var words = line.split(' '); words.sort(); alert(words); } // More concise is not necessarily better // This is jQuery style - chaining function calls. // Problem 4.6 - assume words are separated by exactly one blank function prob46a() { alert(prompt('enter a line of text','').split(' ').sort());