DEV Community

Discussion on: 10 Clean code examples (Javascript).

Collapse
 
yaireo profile image
Yair Even Or • Edited

Number 4...?! what is going on there.. it should be as follows:

var foo = {x:1, y:2}
var {x:a, y:b} = foo
console.log(a,b)
Enter fullscreen mode Exit fullscreen mode
Collapse
 
redbossrabbit profile image
Ibeh Ubachukwu

I guess that works too! 😅