Open this example in the interactive library
Source code
class Status {
static labels;
static {
this.labels = new Map([
[200, "OK"],
[404, "Not found"],
]);
}
}
console.log(Status.labels.get(404));
Sample output
Not found

Open this example in the interactive library
class Status {
static labels;
static {
this.labels = new Map([
[200, "OK"],
[404, "Not found"],
]);
}
}
console.log(Status.labels.get(404));
Not found