mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-13 18:24:39 +02:00
Updates enum docs (#4266)
This commit is contained in:
committed by
GitHub
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 {
|
||||||
|
Reference in New Issue
Block a user