loading
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const obj = {
  name: 'aram',
};
// At the top level this refers to the global object
this.name = 'gohar';
const g = function(last_name, age) {
  return `${this.name} ${last_name} ${age}`;
};
// The first argument must always be the new execution context
// and the other arguments end up being the
// arguments of the original function
const f = g.bind(obj, 'baz');
console.log(f(22));
Native Browser JavaScript