Skip to content

Instantly share code, notes, and snippets.

@shigemk2 shigemk2/enum_x.js
Created Feb 21, 2015

Embed
What would you like to do?
var e;
(function (e) {
e[e["a"] = 0] = "a";
e[e["b"] = 1] = "b";
})(e || (e = {}));
var x;
x = 0 /* a */;
console.log(x);
x++;
var y = x++;
console.log(x);
console.log(typeof x);
console.log(y);
console.log(typeof y);
enum e {
a, b
}
var x: e;
x = e.a;
console.log(x); // 0
x++;
var y = x++;
console.log(x); // 2
console.log(typeof x); // number
console.log(y); // 1
console.log(typeof y); // number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.