I have an array like below
var nums = ["1", "2", "2", "3", "4", "4", "5"];
Here I am trying to compare the values in array and test whether the values are in ascending order or not.
If two array values are same, I need to skip that. If order is like 1,3,2.. then I will throw an error that they are in wrong order. I want to use pure javascript here.