Skip to main content
Mod Removes Wiki by Shog9

Javascript:

function program() {
    var input = [];
    do {
        var num = prompt('Enter a number, or nothing to continue');
        if (num == 'nothing') {
            break;
        }
        input.push(parseDouble(num));
    } while (true);

    var sorted = [];
    return sorted;
}

function parseDouble(str) {
    return parseFloat(str);
}
function program() {
    var input = [];
    do {
        var num = prompt('Enter a number, or nothing to continue');
        if (num == 'nothing') {
            break;
        }
        input.push(parseDouble(num));
    } while (true);

    var sorted = [];
    return sorted;
}

function parseDouble(str) {
    return parseFloat(str);
}
  1. Ending the input sequence requires literally typing "nothing" (case-sensitive and everything).
  2. You've got to create a parseDouble method, because obviously you're not getting doubles otherwise.
  3. Returns the array sorted.

Javascript:

function program() {
    var input = [];
    do {
        var num = prompt('Enter a number, or nothing to continue');
        if (num == 'nothing') {
            break;
        }
        input.push(parseDouble(num));
    } while (true);

    var sorted = [];
    return sorted;
}

function parseDouble(str) {
    return parseFloat(str);
}
  1. Ending the input sequence requires literally typing "nothing" (case-sensitive and everything).
  2. You've got to create a parseDouble method, because obviously you're not getting doubles otherwise.
  3. Returns the array sorted.

Javascript:

function program() {
    var input = [];
    do {
        var num = prompt('Enter a number, or nothing to continue');
        if (num == 'nothing') {
            break;
        }
        input.push(parseDouble(num));
    } while (true);

    var sorted = [];
    return sorted;
}

function parseDouble(str) {
    return parseFloat(str);
}
  1. Ending the input sequence requires literally typing "nothing" (case-sensitive and everything).
  2. You've got to create a parseDouble method, because obviously you're not getting doubles otherwise.
  3. Returns the array sorted.
Source Link
Brian S
  • 131
  • 3

Javascript:

function program() {
    var input = [];
    do {
        var num = prompt('Enter a number, or nothing to continue');
        if (num == 'nothing') {
            break;
        }
        input.push(parseDouble(num));
    } while (true);

    var sorted = [];
    return sorted;
}

function parseDouble(str) {
    return parseFloat(str);
}
  1. Ending the input sequence requires literally typing "nothing" (case-sensitive and everything).
  2. You've got to create a parseDouble method, because obviously you're not getting doubles otherwise.
  3. Returns the array sorted.