Skip to content

Files

Latest commit

 

History

History
21 lines (14 loc) · 1.53 KB

File metadata and controls

21 lines (14 loc) · 1.53 KB

this easy #javascript #objects

by Pawan Kumar @jsartisan

Take the Challenge

Consider the following code:

function createUser() {
  return {
    name: "John Doe",
    ref: this
  };
}

let user = createUser();

alert( user.ref.name ); // What's the result?

What is the result of accessing its ref? Why?


Back Share your Solutions Check out Solutions