how to re-map object keys with spaces?

Hi everyone.

I’d like to re-map some column names from an Excel data sheet. The column names are interpreted as object keys, and the values from the data set have spaces. I can re-map where the object keys have no spaces, but I can’t figure out the correct syntax for doing this where spaces are present.

For example:

data.sheet("Sheet1", {range: "A3:", headers: true}).map(({जम्मा}) => ({
  "new name": जम्मा

works, but

data.sheet("Sheet1", {range: "A3:", headers: true}).map(({"स्थानीय तह"}) => ({
  "new name": "स्थानीय तह"

returns an unexpected token.

I’ve tried using various combinations of brackets, etc, but no luck.

Any insights?

Try this:

data.sheet("Sheet1", {range: "A3:", headers: true}).map(({"स्थानीय तह": name}) => ({
  "new name": name
1 Like

Thank you!!