File tree 2 files changed +24
-12
lines changed
2 files changed +24
-12
lines changed Original file line number Diff line number Diff line change 1
- // First Class Function :
2
- // A function is a value that can be assigned to a variable and passed as an argument to another function.
3
- // It's also a type of object in JavaScript, with properties and methods just like any other object.
1
+ //* First Class Function :
2
+ //* A function is a value that can be assigned to a variable and passed as an argument to another function.
3
+ //* It's also a type of object in JavaScript, with properties and methods just like any other object.
4
4
5
5
var a = function firstcls ( ) {
6
6
console . log ( "hii" ) ;
7
7
} ;
8
8
a ( ) ;
9
9
10
- //firstcls(function () {});
11
- // or
10
+ //? firstcls(function () {});
11
+ //? or
12
12
13
- //setTimeout(function () {}, 3000);
13
+ //? setTimeout(function () {}, 3000);
Original file line number Diff line number Diff line change 1
- const inter = function ( ) {
2
- console . log ( "Hello" ) ;
3
- } ;
1
+ // const arr1 = [1, 2, 3];
2
+ // const arr2 = arr1;
3
+ // console.log(arr2);
4
+ // arr1.pop(1);
5
+ // console.log(arr2);
6
+ // console.log(arr1);
4
7
5
- setTimeout ( inter , 1000 ) ;
8
+ // var x = 2;
9
+ // var y = x;
10
+ // console.log(x);
11
+ // x = 3;
12
+ // console.log(y);
6
13
7
- console . log ( x ) ;
8
- var x = 12 ;
14
+ const fib = n => {
15
+ if ( n <= 1 ) return 1
16
+ return fib ( n - 1 ) + fib ( n - 2 )
17
+ }
18
+
19
+ const res = fib ( 9 ) ;
20
+ console . log ( "Result - " , res )
You can’t perform that action at this time.
0 commit comments