DEV Community

Discussion on: What are your fav ES6 features?

Collapse
 
pengeszikra profile image
Peter Vivo

My favourite is: generator functions. Mandatory use for side effect handling. Or write complex flow programming. But I always use const - arrow - destructuring - rest combo in react:

const StatelessFooComponent = ({data, foo:{x, y}, ...props}) => (
 <section style={{position:'absolute', top:y, left:x}}>
   <pre>{data}</pre>
   <pre>{JSON.stringify({...props}, null, 2)}</pre>
 </section>
);
Collapse
 
madza profile image
Madza

Yeah, I guess I forgot generator functions and iterators ;)