Skip to content

Commit c88da7b

Browse files
committed
callapplybind methods examples
1 parent 77c8092 commit c88da7b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

callapplybind.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ function newf(val1, val2, val3) {
77
var obj = {
88
age: 24,
99
};
10-
newf.call(obj, 1, 2, 3);
10+
// newf.call(obj, 1, 2, 3);
1111

12-
//* apply :
13-
newf.apply(obj, [1, 2, 3]); //gives same values
12+
// //* apply :
13+
// newf.apply(obj, [1, 2, 3]); //gives same values
1414

1515
//* It says that when passing object as argument we should pass 2 arguments so we pass object and function parameters as an array
1616

1717
//* Bind :
1818
var bindObj = newf.bind(obj, 1, 2, 3);
1919
//* newf.bind(obj,1,2,3); gives the function which we should store for display it
20-
21-
console.log(bindObj); // it invoked and give the result
20+
bindObj();
21+
// console.log(bindObj); // it invoked and give the result

0 commit comments

Comments
 (0)