How to use this in function inside object with JavaScript

1 Answer

0 votes
const test = {
  n: 3467,
  func: function() {
    return this.n;
  },
};

console.log(test.func());



/*
run:

3467

*/

 



answered Nov 20, 2020 by avibootz

Related questions

...