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

191
Views
¿Cómo define JavaScript un nuevo tipo de cadena?

Primero, defino una cadena predeterminada.

 var string = new String();

Pero quería tener una cadena más potente, así que agregué algunos métodos al prototipo de cadena.

 String.prototype.md5sck

Eso es bueno, pero espero que sea un tipo nuevo.

 var string2 = new String2(); string2.prototype.substring();//Method with inherit default string string2.prototype.md5sck();//Have additional methods string.prototype.md5sck();//null The system default string method will not be affected.

Y tengo que asegurarme de que mi método no pueda ser modificado por otros.

 var string2 = new string2(); string2.prototype.md5sck = ???; // After new(), I hope this behavior will be prohibited
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

 var string = new String(); String.prototype.md5sck = () => { console.log("md5 check") }; class String2 extends String { // define here } var string2 = new String2(); string2.md5sck()

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!