Javascript Fundamentals - 03 Tasks Exercises - Basic Syntax, Conditional Statements...
Здравейте,
Имам въпрос относно следната задача:
***
3. Division
You will be given a number and you have to return whether that number is divisible by the following numbers: 2, 3, 6, 7, and 10. You should always take the bigger division. If the number is divisible by both 2 and 3 it is also divisible by 6 and you should print only the division by 6. If a number is divisible by 2 it is sometimes also divisible by 10 and you should print the division by 10. If the number is not divisible by any of the given numbers print "Not divisible". Otherwise, print "The number is divisible by {number}".
***
Пробно решение : https://pastebin.com/UNfDdNQw
Стигам до момента в който проверявам последователно дали може да се дели на 2,3,6,7,10.
И после искам да си ги сравня за да принтирам по голямата стойност. Но нещо не се получава.
Опитвах с math.max, но явно някъде греша...
Благодаря!