Change Key in JSON, when DASH "-" is present in key – nodeJS or JavaScript

I have no idea how to rename key that has dash in it. for example

obj.Fast-Italian = obj.Fast-Car1;

While below code works for keys that doesn’t contain dash "-":

var json = '[{"_id":"5078c3a803ff4197dc81fbfb","email":"","image":"some_image_url","name":"Name 1"}]';

var obj = JSON.parse(json)[0]; = obj._id;
delete obj._id;
json = JSON.stringify([obj]);
fs.writeFileSync('output1.json', json);

I can’t use above for this JSON:

var json = '[{"Fast-Car1":"Ferrari F40 Cabrio","Fast-Car2":"Audi R8 Black Edition","Fast-Car3":"Nissan GTR Blue"},{"Fast-Car1":"Lambo Diablo Fire Colors","Fast-Car2":"Skoda RS 4 doors","Fast-Car3":"Honda NSX red paint"}]'
    // what I need to go here is change Fast-Car1 Fast-Italian, Fast-Car2 = Fast-German, Fast-Car3 = Fast-Japanese

Problem is I don’t know how to make this work:

obj.Fast-Italian = obj.Fast-Car1;

due to dash "-" in Key name.

    //so final JSON would look like this:
    var json = '[{"Fast-Italian":"Ferrari F40 Cabrio"},{"Fast-German":"Audi R8 Black Edition"},{"Fast-Japanese":"Nissan GTR Blue"},,{"Fast-Italian":"Lambo Diablo Fire Colors","Fast-German":"VW Golf RS silver","Fast-Japanese":"Honda NSX red paint"}]'
    // JSON has big amount of those, so I will loop anyway, but I have no idea how to 

I tried this :

var obj = JSON.parse(json)[0];
obj.[Fast-Italian] = obj.['Fast-Car1'];
delete obj._id;

but then got error:

// = obj.['Fast-Car1'];
// SyntaxError: Unexpected token '['

Extra note:
JSON comes from Excel where each column has Fast-[Something] (in case you were wondering why I have JSON keys with dash "-")

162 thoughts on “Change Key in JSON, when DASH "-" is present in key – nodeJS or JavaScript”

  1. Pingback: sildenafil coupon
  2. Pingback: viagra generic
  3. Pingback: cialis on line
  4. Pingback: get cialis
  5. Pingback: sildenafil 50 mg
  6. Pingback: natural viagra
  7. Pingback: viagra online
  8. Pingback: viagra samples
  9. Pingback: cialis coupon
  10. Pingback: 400 mg sildenafil
  11. Pingback: sildenafil 20
  12. Pingback: how to buy cialis
  13. Pingback: alternative viagra
  14. Pingback: cheap cialis
  15. Pingback: buy viagra
  16. Pingback: sildenafil citrate
  17. Pingback: online viagra
  18. Pingback: cheap viagra ebay