it is pretty useful, I think it has become better to work with collections, if you have teamates with python background, they can easily recognize [...someIterable] also it lets you do some stuff like const keys = [...Object.keys(myObj)] without for in or for each
also for people that isn't too much into functional methods like map, reduce, ans such, for of is quite a savior.
on the protocol vs interface, I think protocol is better suited in jsland where interfaces only exist on agreements (which some times not everyone agrees the same thing), not enforced in code.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What are your thoughts on
iterator
as a protocol and not an interface?it is pretty useful, I think it has become better to work with collections, if you have teamates with python background, they can easily recognize
[...someIterable]
also it lets you do some stuff likeconst keys = [...Object.keys(myObj)]
withoutfor in
orfor each
also for people that isn't too much into functional methods like map, reduce, ans such,
for of
is quite a savior.on the protocol vs interface, I think protocol is better suited in
jsland
where interfaces only exist on agreements (which some times not everyone agrees the same thing), not enforced in code.