📜  javascript 高级概念 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:43.559000             🧑  作者: Mango

代码示例2
var user = {     name: "Rahul Mhatre",     whatIsYourName: function() {     console.log(this.name);     }};user.whatIsYourName(); // Output: "Rahul Mhatre",var user2 = {     name: "Neha Sampat"};user.whatIsYourName.call(user2); // Output: "Neha Sampat"