JavaScript sorts numbers in an array in order of size
刘虎
刘虎 2019-11-02 10:56:31
0
3
1274

I am a newbie who just started learning, and I don’t know much. During my study, I found that the arrays are not completely arranged in size order when sorted using sort(). It has something to do with the number of digits, so I thought that I I tried to arrange the array in order from small to large, and typed some code myself, but in the end there was still a problem. Please explain and correct me.%

刘虎
刘虎

reply all (2)
卢小强

It is recommended that if you want to write sorting by yourself, you can download the sorting method on Baidu. I personally recommend bubble sorting method.

  • reply I know there must be a way to see it, because I don’t know much now. What I’ve made with my skills is like the one above. I don’t know what’s wrong with it.
    刘虎 author 2019-11-02 13:52:06
卢小强
I tried it and there seems to be no problem


    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!