Get the App
SLTechnology News&Howtos  ›  Development  › 

How js sorts arrays in random order

Shulou Source: shulou.com Published: 2022-06-01 03:22:15 09月22日 Update

This article will explain in detail how js sorts arrays in random order. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Sort the array in random order

Example

Var points = [40,100,1,5,25,10]; points.sort (function (a, b) {return 0.5-Math.random ()}); this is the end of the article on "how js sorts arrays in random order". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Array order sort articles more good practical content examples articles knowledge references help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux NVidia Docker Xiaomi macOS