Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Study</title>
- </head>
- <body>
- <script>
- 'use strict'
- function mult(num, div = 2) {
- if (div > num / 2) {
- console.log(num);
- return;
- }
- if (num % div == 0) {
- console.log(div);
- mult(Math.floor(num / div), div);
- }
- else {
- mult((num), ++div);
- }
- }
- mult(42);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement