Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

255
Vistas
¿Cómo puedo pasar la variable a la función cuando el texto del script en los cochecitos
 function domHTML(script, contact = {}, user = {}) { console.log(contact.first_name); console.log(user.name); let dom = ` <div class="main py-3 w-100"> <div class="container"> <div class="content"> ${script} </div> </div> </div>`; console.log(dom); //return dom;} let script = `Hey ${contact.first_name}, ${contact.first_name} this is ${user.name} giving you a quick call from the benefits office here in ${contact.state}. I'll have you have the phone here sec but they have me giving you a quick call because of a form you filled out requesting more information about the life insurance programs through the state of ${contact.state}. They have me, the field underwriter, calling to verify the information, I have DOB as ${contact.birthday} is that correct? Perfect, so ${contact.first_name} like I said I'm just the field underwriter they have calling to let you know your request has been processed.

Estamos haciendo todo virtualmente ahora debido a covid. Toma alrededor de 10-15 minutos para obtener la información. Tome un bolígrafo y papel para las notas y eliminará esto para que no reciba más llamadas.

Quiero hacer que todas las variables se reemplacen con argumentos de función

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Puede convertir su secuencia de script en una función que acepte argumentos y pasarla a domHTML , de esa manera la función de secuencia de script puede pasarle las variables de contact y user .

 function domHTML(fn ,contact = {}, user = {}) { let theScript = fn(contact, user) let dom = ` <div class="main py-3 w-100"> <div class="container"> <div class="content"> ${theScript} </div> </div> </div>`; return dom; } function script(contact, user){ return `Hey ${contact.first_name}, ${contact.first_name} this is ${user.name} giving you a quick call from the benefits office here in ${contact.state}. I'll have you have the phone here sec but they have me giving you a quick call because of a form you filled out requesting more information about the life insurance programs through the state of ${contact.state}. They have me, the field underwriter, calling to verify the information, I have DOB as ${contact.birthday} is that correct? Perfect, so ${contact.first_name} like I said I'm just the field underwriter they have calling to let you know your request has been processed.` } const dom = domHTML(script, contact, user) console.log(dom)
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda