-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
65 lines (38 loc) · 1.1 KB
/
Copy pathscript.js
File metadata and controls
65 lines (38 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
function bigerString(list) {
let pos = 0
let stringLenght = 0
for (i in list) {
if (list[i].length > stringLenght) {
pos = i
stringLenght = list[i].length
}
}
return list[pos]
}
function returnAsteristicos(list) {
total = bigerString(list).length
asteristics = ""
for (i=0; i < total + 4; i++) {
asteristics += '*'
}
return asteristics
}
function stringAndAsteristics(list) {
bigerString(list)
asteristics = returnAsteristicos(list)
console.log(asteristics)
for (let i of list) {
let finalWord = '* '
let arrayOfString = i.split(',')
for (let x of arrayOfString) {
finalWord += x
}
while (finalWord.length < asteristics.length - 2) {
finalWord += ' '
}
finalWord += ' *\n'
console.log(finalWord)
}
console.log(asteristics)
}
// stringAndAsteristics(returnAsteristicos, bigerString, ['ana', 'mariapaula', 'SINTAXY_ACADEMY', 'STEFAN_JUNIOR_FULLSTACK_DEVELOPER', 'its_working_bro', 'nhaManoHericles'])