Answers for "interviewbit + js"

1

interviewbit + js

var obj1 = {
  valueOfThis: function(){
    return this;
  }
}
var obj2 = {
  valueOfThis: ()=>{
    return this;
  }
}

obj1.valueOfThis(); // Will return the object obj1
obj2.valueOfThis(); // Will return window/global object
Posted by: Guest on June-17-2021

Browse Popular Code Answers by Language