about summary refs log tree commit diff
path: root/usth/ICT3.2/prac/2/9.js
blob: 628b9b41834d3b1c4ff6ea91e1f54ce8cdbca003 (plain) (blame)
1
2
3
4
5
6
7
8
9
function second(a) {
    let b = [...a].sort();
    return [b[1], b[b.length-2]];
}

if (!module.parent) {
    let [min, max] = second(process.argv.slice(2));
    console.log(`${min} and ${max}`);
}