79703364

Date: 2025-07-16 11:56:40
Score: 1
Natty:
Report link

I saw a colleague of mine use this neat trick to one-line it:

const obj = { up: 1, down: 2, left: 3 };

// rename left -> right
console.log(
    (({ left, ...rest }) => ({ right: left, ...rest }))(obj)
);  
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: dyma