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

299
Views
Is okay for function name() and prototype.name to have the same name

Is okay for a global & prototype function name to have the same function name.

function doThis(){}

&

el.prototype.doThis = function (){}

Can these two be used together in the same script?

I tried it and they both worked correctly, but I need to know if it's safe to use them together.

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

0

Yes you can. They are stored in different scopes

function doThis(){}

Is in your global script scrope. // doThis();

el.prototype.doThis = function (){}

Is only accessable with the specified object el // el.doThis();

I would prefer to name them differently to avoid misunderstandings.

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!