DEV Community

Discussion on: JavaScript tips & tricks

Collapse
 
lioness100 profile image
Lioness100

This is such an amazing resource! A few things:

  • To flatten an array, can't you just use Array#flat?
  • You probably shouldn't use Object.stringify to clone an array, as it will ignore any non-json compliant values, like maps, sets, etc.
  • The bitwise operator ~~ only works as a substitute for Math.floor with positive numbers