Re:What’s New in ES2019
by pcr910303 on Tuesday July 30, 2019 @07:09AM
(#20563719)
That can’t show the programmer’s intent whether it is mutation (e.g. a = a + someNum) verses defining a new variable with different types (but has a similar meaning so has a same name) (e.g. someKindOfData = [...someKindOfData])
Rust allows this, and it really clears codes up. I don’t have to make up different identifiers for same data but different representations.
(e.g. I would do the above code in JS as... someKindOfDataAsArray =
[...someKindOfObectAsNodeList])
Rust allows this, and it really clears codes up. I don’t have to make up different identifiers for same data but different representations. (e.g. I would do the above code in JS as... someKindOfDataAsArray = [...someKindOfObectAsNodeList])