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

168
Vistas
How to make Object value to Object property in JavaScript

I have an Object named category. Here the property/keys are in short-form and the value is in fullform. I need to assign Object property/keys to Object value for a short time moment.
Like.

'Technology' have to make tech

const category = {
    tech: 'Technology',
    gnr: 'General',
    ent: 'Entertainment',
    sci: 'Science',
}
let a 
a=Object.values(category).map(i=>{
 Object.keys(category).map(j=>{
   i=j
 })
})
console.log(a)

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

0

const categories = {
    tech: 'Technology',
    gnr: 'General',
    ent: 'Entertainment',
    sci: 'Science',
}

const predicate = 'General';

let match;

for (const category in categories) {
    if (categories[category] === predicate) {
        match = category;
    }
}

console.log(match);

about 4 years ago · Juan Pablo Isaza Denunciar

0

let a = {};
for (let key in category)
{
    a[category[key]] = key;
}

or

let a = {};
Object.entries(category).forEach(kv=>a[kv[1]]=kv[0]);

about 4 years ago · Juan Pablo Isaza Denunciar

0

Nope! Now after getting match with parameter that I will pass, I need that matching parameter Object Value's Property/Keys.
Like, If General Match then I need gnr
Here I am getting 'General' but I need gnr

const category = {
    tech: 'Technology',
    gnr: 'General',
    ent: 'Entertainment',
    sci: 'Science',
}
let a 
a=Object.values(category).filter(i=>{
  if(i=='General')  {
return Object.keys(i)
  }
 
})
console.log(a)

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