ajhsu / blog

The external storage of my brain.
3 stars 0 forks source link

The trick of `console.log({ obj })` #10

Open ajhsu opened 7 years ago

ajhsu commented 7 years ago
const arr = ['foo', 'bar'];
const copy = arr.slice();
console.log({ arr });
console.log({ copy });

/*
  Would dump an Object in details like:
  { arr: [ 'foo', 'bar' ] }
  { copy: [ 'foo', 'bar' ] }
*/