I am currently working with an array as shown below
var nums = ["1", "2", "2", "3", "4", "4", "5"];
My goal is to compare the values in the array and determine whether they are in ascending order or not.
In case two values in the array are identical, I should ignore them. If the order of values is incorrect (e.g. 1,3,2..), then I need to throw an error. I prefer to accomplish this using only pure JavaScript.