From f758e9d0f548828f3fc06d29ad39c65e09b09097 Mon Sep 17 00:00:00 2001 From: github-AlehMatsukevich Date: Thu, 11 Mar 2021 11:34:59 +0300 Subject: [PATCH] feat: add index.js --- index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 00000000..c9e8ae43 --- /dev/null +++ b/index.js @@ -0,0 +1,11 @@ +const array = [1, 2, 3, 4] +const min = Math.min(...array) +console.log(min) + +const max = Math.max(...array) +console.log(max) + +let sum = array.reduce((sum, current) => sum + current,0) +//console.log(sum) +const avg = sum / array.length +console.log(avg)