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!
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!