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

125
Visualizações
Javascript object result has additional character

This question might be ridiculous but I tried searching everywhere but I just can't find a good reference.

Why does some object in javascript has the structure like in the image attached below? enter image description here

There is t character. And how do I convert the normal object to that form? For instance:

{
    key: "training",
    amount: 4500,
    currency: "PLN",
    label: "Training",
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The character t is the class name of the object that is passed as the value of the key value. As user @Vishnudev mentioned in the comments.

Consider the following code to recreate the JavaScript object and its structure in the image.

Code

class t{
  constructor( amount, currency, _sdkType) { 
    this.amount = amount
    this.currency = currency
    this._sdkType = _sdkType
  }
}
let value = new t(4500, "PLN", "Money")
let object = {
  value: value
}

console.log(object)

Output

Result as seen in the browser console.

enter image description here

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