3 ms·
Oh, you're right! http://www.typescriptlang.org/play/#src=enum%20Direction%20%7B%0A%20%20%20%20Up%20%3D%201%2C%0A%20%20%20%20Down%2C%0A%20%20%20%20Left%2C%0A%2
by sbjs 8y ago
Oh, you're right!
http://www.typescriptlang.org/play/#src=enum%20Direction%20%7B%0A%20%20%20%20Up%20%3D%201%2C%0A%20%20%20%20Down%2C%0A%20%20%20%20Left%2C%0A%20%20%20%20Right%2C%0A%7D%0A http://www.typescriptlang.org/play/#src=enum%20Direction%20%...
And yeah this could be valid JavaScript too, having nothing to do with types, but it's not in JS, only TS.
That said, it is a very cool and clever way to set k=v and v=k in an object at the same time!