From 8644699f4d2fce12a41289f9627bc45be9dd1965 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Thu, 3 Dec 2020 09:32:13 +0700 Subject: [usth/ICT3.2] Develop web applications --- usth/ICT3.2/prac/2/9.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 usth/ICT3.2/prac/2/9.js (limited to 'usth/ICT3.2/prac/2/9.js') diff --git a/usth/ICT3.2/prac/2/9.js b/usth/ICT3.2/prac/2/9.js new file mode 100644 index 0000000..628b9b4 --- /dev/null +++ b/usth/ICT3.2/prac/2/9.js @@ -0,0 +1,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}`); +} -- cgit 1.4.1