DEV Community

Discussion on: 17 Javascript optimization tips to know in 2021 🚀

Collapse
 
bugmagnet profile image
Bruce Axtens

Thanks for pointing that out, @estruyf . The following deno session demonstrates

> const b = "abcdef".split("")
undefined
> b
[ "a", "b", "c", "d", "e", "f" ]
> for (let x in b) console.log(x)
0
1
2
3
4
5
undefined
> for (let x of b) console.log(x)
a
b
c
d
e
f
undefined
Enter fullscreen mode Exit fullscreen mode