Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

251
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda