r/javascript • • Mar 18 '19

What's your favorite, most useful javascript one-liner?

385 Upvotes

422 comments sorted by

View all comments

2

u/ovpv Mar 19 '19

const obj = { foo: "john", bar : "doe"};

const {foo,bar} = obj;

1

u/SarahC Mar 19 '19

Is this how that one linker works with Math?

const {abs, floor, random} = Math;
 
console.log(  abs(-5)  );

What's the technique called?