Rearrange array to one line
Rearrange the array content on only one line, and remove trailing commas
Start file
const data = [ { goal: 400, }, { goal: 300, }, { goal: 200, }, { goal: 300, }, { goal: 200, }, { goal: 278, }, { goal: 189, }, { goal: 239, }, { goal: 300, }, { goal: 200, }, { goal: 278, }, { goal: 189, }, { goal: 349, }, ]
End file
const data = [ { goal: 400 }, { goal: 300 }, { goal: 200 }, { goal: 300 }, { goal: 200 }, { goal: 278 }, { goal: 189 }, { goal: 239 }, { goal: 300 }, { goal: 200 }, { goal: 278 }, { goal: 189 }, { goal: 349 } ]
View Diff
2,40c2 < { < goal: 400, < }, < { < goal: 300, < }, < { < goal: 200, < }, < { < goal: 300, < }, < { < goal: 200, < }, < { < goal: 278, < }, < { < goal: 189, < }, < { < goal: 239, < }, < { < goal: 300, < }, < { < goal: 200, < }, < { < goal: 278, < }, < { < goal: 189, < }, < { < goal: 349, < }, --- > { goal: 400 }, { goal: 300 }, { goal: 200 }, { goal: 300 }, { goal: 200 }, { goal: 278 }, { goal: 189 }, { goal: 239 }, { goal: 300 }, { goal: 200 }, { goal: 278 }, { goal: 189 }, { goal: 349 }
Solutions by @MatFriend:
Unlock 8 remaining solutions by signing in and submitting your own entry