Comparing various way to check if a string is within the values of a typescript enum . (version: 0)
Given this typescript code
// typescript like
enum Status {
A = 'a',
B = 'b',
C = 'c',
D = 'd'
}
what is the faster simpler way to know if a string st is within the enum values.
Comparing performance of: compare individual strings vs use a regex vs use a set
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory
Test case name
Result
compare individual strings
use a regex
use a set
Fastest:N/A
Slowest:N/A
ⓘGet performance results from real users on your website with Request Metrics.