-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchallenges.js
More file actions
40 lines (32 loc) · 830 Bytes
/
challenges.js
File metadata and controls
40 lines (32 loc) · 830 Bytes
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
// function sumPolygon(n){
// return (n-2) * 180
// }
// console.log(sumPolygon(3));
// console.log(sumPolygon(4));
// console.log(sumPolygon(6));
// function nameString(string){
// return string + 'Edabit'
// }
// console.log(nameString("Mubashir"));
// console.log(nameString("Javascript"));
// function numArgs(){
// return arguments.length
// }
// console.log(numArgs({},"dlfpd",1));
// function numArgs(...args){
// return args.length
// }
// console.log(numArgs({},"dlfpd",1));
// function invertedArray(arr){
// return arr.map((i)=>i==0 ? 0 : i * -1)
// }
// console.log(invertedArray([1,2,3,4,5]));
// function mod(a,b){
// return a % b
// }
// console.log(mod(5,2));
// console.log(mod(218,5));
// function mod2(a,b){
// return (a - b * parseInt(a / b))
// }
// console.log(mod2(5,2));