Answers for "this jvascript"

1

this js

let user = {
  name: "John",
  age: 30,

  sayHi() {
    // "this" is the "current object"
    alert(this.name);
  }

};

user.sayHi(); // John
Posted by: Guest on January-09-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language