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

151
Vistas
Is there a way to save an appended JSON object in JavaScript?

I have a large json file with ~45,000 objects and 15 million keys that I've managed to append with JavaScript. I'm able to log out the new, desired json object but only for about 600 of the 45,000 objects. Is it possible to save the updated object to a file?

I'm looking to either:

  1. Overwrite the original file with the new content.
  2. Save the updated object to new file.
  3. Use any alternative option that will let me work with the output of this code in its entirety.

I'm very new so just getting to this point was a massive feat. I'd apprecitate any guidance and insight you have to offer.

Here is my code:

var data = require('./BC_Data.json');
var y = data.features.map((property) => property.properties.GAZETTED_NAME)

var language = {
    waterbody: ""
}

for (var i=0; i < y.length; i++) {
var input = data.features[i].properties.GAZETTED_NAME;

    if (input != null) {
    var sentence = input.toLowerCase().split(" ");
    for (var x=0; x < sentence.length; x++) {
        sentence[x] = sentence[x][0].toUpperCase() + sentence[x].slice(1)
    } 
    language.waterbody = sentence.join(" ")
    var obj = Object.assign(data.features[i], language)
    console.log(obj) // Desired Output to be saved
    } else 
    language.waterbody = ""
}
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