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

313
Views
¿Cuál es la diferencia entre `document.createTextNode` y `new Text()`?

Ambos crean un nuevo nodo Texto . Parece que la única diferencia es la compatibilidad del navegador. ¿Hay alguna otra diferencia?

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Parecería que, de acuerdo con el estándar DOM, casi no hay diferencia:

 text = new Text([data = ""])

Devuelve un nuevo nodo Texto cuyos datos son datos. (Enlace)

 text = document . createTextNode(data)

Devuelve un nodo Texto cuyos datos son datos. (Enlace)

excepto por el hecho de que el argumento es opcional para el constructor, pero requerido para createTextNode . (Omitir el argumento para createTextNode arrojará).

 new Text(); console.log('first line worked'); document.createTextNode(); // throws

about 4 years ago · Santiago Gelvez 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!