File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- function reverse ( str ) {
2- return str . split ( '' ) . reverse ( ) . join ( '' ) ;
3- }
1+ // function reverse(str) {
2+ // return str.split('').reverse().join('');
3+ // }
4+
5+ // function isPalindrome(str) {
6+ // return reverse(str) === str;
7+ // }
8+
9+
10+ // function sayHello() {
11+ // console.log("Hello, World!");
12+ // }
13+
14+ // sayHello();
15+
16+ // function sumToN(n) {
17+ // let sum = 0;
18+ // for (let i = 0; i <= n; i++) {
19+ // sum += i;
20+ // }
21+ // return sum;
22+ // }
23+
24+ // console.log(sumToN(3));
425
5- function isPalindrome ( str ) {
6- return reverse ( str ) === str ;
26+ // function plusTwo(num) {
27+ // return num + 2;
28+ // }
29+
30+ // let a = 2;
31+
32+ // for (let i=0; i < 4; i++) {
33+ // a = plusTwo(a);
34+ // }
35+
36+ // console.log(a);
37+
38+ // function repeater(str) {
39+ // let repeated = str + str;
40+ // console.log(repeated);
41+ // }
42+
43+ // repeater('Bob');
44+
45+ function repeater ( str ) {
46+ let repeated = str + str ;
47+ console . log ( repeated ) ;
748}
49+
50+ repeater ( 'Bob' ) ;
Original file line number Diff line number Diff line change 11function sayHello ( ) {
22 console . log ( "Hello, World!" ) ;
33}
4+
5+
6+
7+ // let num = 42;
8+
9+ // function isEven (num) {
10+ // return num % 2 === 0;
11+ // }
12+
13+ // console.log(isEven(43));
14+
15+
16+
You can’t perform that action at this time.
0 commit comments