diff --git a/03.02.01. stringLength.js b/03.02.01. stringLength.js new file mode 100644 index 0000000..37187d9 --- /dev/null +++ b/03.02.01. stringLength.js @@ -0,0 +1,14 @@ +/* +Write a JS function that takes three string arguments as an input. +Calculate the sum of the length of the strings and the average length of the strings rounded down to the +nearest integer. +The input comes as three string arguments passed to your function. +The output should be printed on the console on two lines. +*/ +function main(str1, str2, str3){ + let sum = str1.length + str2.length + str3.length; + console.log(sum); + console.log(Math.floor(sum/3)); + +} +main('chocolate', 'ice cream', 'cake'); \ No newline at end of file