Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
What is "this.return" in JavaScript?

While in VS Code, I hit the tab after typing return and the VS Code Intellisense auto-completed "return" to "this.return".

I've never seen this before and cannot find any documentation on it.

Does anybody know if this is actually a thing, or if VS Code possibly lost it's marbles.

Note: the object I was working in does not have any properties or functions called "return".

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Well, an object could have a property called return:

const obj = {
  return: () => { console.log('↩️'); }
};

obj.return();

Were you in the context of a class that had a return property, or maybe its superclass did?

(Honestly it seems more likely VS Code was just being weird.)

about 4 years ago · Juan Pablo Isaza Report

0

You can run console.log("this", this) in most modern browsers this will return the JSON data of this (the variable this refers to the current instance of declared object FYI), and console.log(typeof(this.return)) and it will likely return function (if you get undefined just change it from this.return to return;)

Likely the object either has a property called return that is a function, or something has gone wrong in the autocomplete.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!