1
- function isEven ( x ) {
2
- if ( x = 2 || x % 2 == 0 ) {
3
- console . log ( `${ x } is even` )
4
- } else
5
- console . log ( `${ x } is odd` )
1
+ function isEven ( x ) {
2
+ if ( ( x = 2 || x % 2 == 0 ) ) {
3
+ console . log ( `${ x } is even` ) ;
4
+ } else console . log ( `${ x } is odd` ) ;
6
5
}
7
6
8
- function isNumber ( num ) {
9
- let x = undefined
10
- x = num % 2
11
- if ( false ) {
12
- console . log ( "Number is false" )
13
- } else if ( ! ! x ) {
14
- console . log ( `Number: ${ x } ` )
15
- } else if ( 2 == x ) { }
7
+ function isNumber ( num ) {
8
+ let x = undefined ;
9
+ x = num % 2 ;
10
+ if ( false ) {
11
+ console . log ( "Number is false" ) ;
12
+ } else if ( ! ! x ) {
13
+ console . log ( `Number: ${ x } ` ) ;
14
+ } else if ( 2 == x ) {
15
+ }
16
16
}
17
17
18
18
function isTruthy ( x ) {
19
- debugger ;
20
- return Boolean ( x ) ;
21
- } ;
19
+ debugger ;
20
+ return Boolean ( x ) ;
21
+ }
22
22
23
23
function area ( r ) {
24
- let math = Math ( )
25
- return math . PI * r * r ;
24
+ let math = Math ( ) ;
25
+ return math . PI * r * r ;
26
26
}
27
27
28
- function isFooAvailable ( obj ) {
29
- console . log ( `Value of obj[foo]: ${ obj [ ' foo' ] } ` )
30
- return obj . hasOwnProperty ( ' foo' )
28
+ function isFooAvailable ( obj ) {
29
+ console . log ( `Value of obj[foo]: ${ obj [ " foo" ] } ` ) ;
30
+ return obj . hasOwnProperty ( " foo" ) ;
31
31
}
32
32
33
- function findFooBar ( ) {
34
- var re = / = f o o b a r / ;
35
- re . test ( ' foobar' )
33
+ function findFooBar ( ) {
34
+ var re = / = f o o b a r / ;
35
+ re . test ( " foobar" ) ;
36
36
}
37
37
38
- function consoleFoo ( num ) {
39
- while ( ( num != 3 ) ) {
40
- break ;
41
- console . log ( num -- )
42
- }
43
-
38
+ function consoleFoo ( num ) {
39
+ while ( num != 3 ) {
40
+ break ;
41
+ console . log ( num -- ) ;
42
+ }
44
43
}
45
44
46
- function isGreaterThan ( arr , x ) {
47
- if ( Array . isArray ( arr ) ) {
48
- arr . map ( ( n ) => {
49
- return ! ( n > x ) ? n : arguments . callee ( n - 1 ) * n ;
50
- } ) ;
51
- } ;
45
+ function isGreaterThan ( arr , x ) {
46
+ if ( Array . isArray ( arr ) ) {
47
+ arr . map ( ( n ) => {
48
+ return ! ( n > x ) ? n : arguments . callee ( n - 1 ) * n ;
49
+ } ) ;
50
+ }
52
51
}
53
52
54
- function callHiEveryMinutes ( x ) {
55
- if ( ! window && x ) {
56
- setTimeout ( "alert('Hi')" , x * 1000 )
57
-
58
- } else window . setTimeout ( "alert('Hi')" , x * 1000 )
53
+ function callHiEveryMinutes ( x ) {
54
+ if ( ! window && x ) {
55
+ setTimeout ( "alert('Hi')" , x * 1000 ) ;
56
+ } else window . setTimeout ( "alert('Hi')" , x * 1000 ) ;
59
57
}
60
58
61
59
let result = isFooAvailable ( {
62
- ' bar' : ' bar' ,
63
- 'z' : 'z'
64
- } )
60
+ bar : " bar" ,
61
+ z : "z" ,
62
+ } ) ( ( function ( ) { } ) ( ) , 0 ) ;
65
63
66
- ( function ( ) { } ( ) , 0 ) ;
67
-
68
- function checkYoda ( ) {
69
- let yoda = true ;
70
- if ( true == yoda ) {
71
- console . log ( "I am yoda" )
72
- }
73
- }
64
+ function checkYoda ( ) {
65
+ let yoda = true ;
66
+ if ( true == yoda ) {
67
+ console . log ( "I am yoda" ) ;
68
+ }
69
+ }
0 commit comments