loading
open in
main.js
1
2
3
4
5
6
7
8
9
10
11
12
const obj = {
  name: 'aram',
};
// At the top level this refers to the global object
this.name = 'gohar';
const g = function(last_name) {
  // This is using ES6 string interpolation, aka the ${}
  return `${this.name.toUpperCase()} ${last_name}`;
};
const f = g.bind(obj);
console.log(f('baz'));
Native Browser JavaScript