// Handle a command.
var handler = function(command) {
if (command) {
try {
jqconsole.Write('==> ' + calculator.parse(command) + '\n');
} catch (e) {
jqconsole.Write('ERROR: ' + e.message + '\n');
}
}
jqconsole.Prompt(true, handler);
};
// Initiate the first prompt.
handler();