What did you search up? When I search up “js sort array” I get Jovanny’s solution as the first result?
If you want to search up how to do something, I recommend you put your programming language in the search query (as what you are looking for may be a built-in feature, and you get the benefit of being able to simply copy+paste code you find if it’s something like an algorithm) and try to simplify the search query. Did you put “wick” in the query? If so, that might not give you good results (since Wick isn’t that well-known). But Wick uses JavaScript, and that is very widely used, so if you put “javascript” or “js” you will get better results.
I think you can use +quote
instead, I think it’s faster. You can also use parseFloat(quote)
or parseInt(quote)
instead but I’m not sure how efficient they are. Use parseFloat if what you want is a number with a decimal point, and parseInt if it has no decimal point.
P.S. parseFloat
is called that way because numbers with decimal points in JavaScript are really what is called “floating-point numbers”, in case you didn’t know. I think it’s called that way because the decimal point can move around? Search that up
another edit: i moved where “in JavaScript” was in case people might get confused because floating-point numbers are used everywhere and they are called that everywhere. and the way i wrote it made it so it can be interpreted as “in JavaScript terminology, they are called floating-point numbers” and not “JavaScript uses floating-point numbers”