I have an array which contains the below values and I am trying to sort the values in the array using arr.sort() but not seeing any change in output, it's still returning the same array format
var arr = ["swagger-regional-1.20.1.yaml",
"swagger-regional-1.20.2.yaml",
"swagger-regional-1.7.0.yaml",
"swagger-regional-1.8.2.yaml",
"swagger-regional-1.8.3.yaml",
"swagger-regional-1.8.4.yaml",
"swagger-regional-1.8.5.yaml",
"swagger-regional-1.9.0.yaml",
"swagger-regional-1.9.1.yaml",
"swagger-regional-1.9.2.yaml"];
arr.sort()
Expected output:
["swagger-regional-1.7.0.yaml",
"swagger-regional-1.8.2.yaml",
"swagger-regional-1.8.3.yaml",
"swagger-regional-1.8.4.yaml",
"swagger-regional-1.8.5.yaml",
"swagger-regional-1.9.0.yaml",
"swagger-regional-1.9.1.yaml",
"swagger-regional-1.9.2.yaml",
"swagger-regional-1.20.1.yaml",
"swagger-regional-1.20.2.yaml"]