Basically, I'm trying to figure out what the difference is between these 3 statements? Is there any reason to use one instead of the others? Is the first one bad practice (it works but I never see it and doesn't seem to be taught anywhere)?
+'21';
Number('21');
parseInt('21');
Numberstands out. But if you have something likereturn +resultthat should be fine. A unary plus is idiomatic but I personally preferNumberfor conversions because it's easier to see and you can also use it in something like["1", "2", "3"].map(Number)