File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -2091,3 +2091,33 @@ function isValidZip(zip) {
2091
2091
2092
2092
---
2093
2093
**[⬆ Back to Top](#header)**
2094
+
2095
+
2096
+
2097
+ ##### 57. Create a function that takes a number as an argument and returns the highest digit in that number.
2098
+
2099
+
2100
+ ` ` ` js
2101
+ function highestDigit (number ){
2102
+ // Write Your solution Here
2103
+ };
2104
+
2105
+
2106
+ console .log (highestDigit (3456 )); // 6
2107
+ console .log (highestDigit (21098 )); // 9
2108
+ console .log (highestDigit (56123 )); // 6
2109
+ ` ` `
2110
+
2111
+ <details><summary style="cursor:pointer">Solution</summary>
2112
+
2113
+ ` ` ` js
2114
+ const highestDigit = (number ) => {
2115
+ let arr = (number .toString ().split (' ' ))
2116
+ return Math .max (... arr)
2117
+ }
2118
+ ` ` `
2119
+
2120
+ </details>
2121
+
2122
+ ---
2123
+ **[⬆ Back to Top](#header)**
You can’t perform that action at this time.
0 commit comments