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

252
Vistas
Parsing Javascript cookie values and separating values

I'm still learning Javascript and I'm trying to parse a value from a cookie in a specific key:

I'm using this current line:

const cookieObj = new URLSearchParams(document.cookie.replaceAll("; ","&","|")) cookieObj.get("LG_AFF_TRK")

LG_AFF_TRK is the key that I'm pulling the value from. Doing so creates the output value of the following:

1|2|3|4|5|6

Each number represented would be a value that will have a random number of characters -and- could possibly be empty but each section always be separated by the "|" symbol.

How can I pull a specific value? As an example question, what do I need to do pull value 3?

I'm trying to understand this logically and my guess is I have to create an array first?

about 4 years ago · Juan Pablo Isaza
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