2 ms·
Which, in real life, makes you parse (and handle or throw errors or log, whatever you want) but then now that the item you have is what you need. Another way y
by epolanski 3y ago
Which, in real life, makes you parse (and handle or throw errors or log, whatever you want) but then now that the item you have is what you need.
Another way you can implement the same: through a class constructor like new UserId('some string') which can also throw or let you handle operations on the class itself while allowing you to get the value.