mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Updates enum docs (#4266)
This commit is contained in:
parent
04690c7057
commit
0320846c0c
@ -48,6 +48,7 @@ let list: Array<number> = [1, 2, 3];
|
|||||||
// For enumerations:
|
// For enumerations:
|
||||||
enum Color { Red, Green, Blue };
|
enum Color { Red, Green, Blue };
|
||||||
let c: Color = Color.Green;
|
let c: Color = Color.Green;
|
||||||
|
console.log(Color[c]); // "Green"
|
||||||
|
|
||||||
// Lastly, "void" is used in the special case of a function returning nothing
|
// Lastly, "void" is used in the special case of a function returning nothing
|
||||||
function bigHorribleAlert(): void {
|
function bigHorribleAlert(): void {
|
||||||
|
Loading…
Reference in New Issue
Block a user