JavaScript Native Array.prototype.sort() and _.sortBy() sorts values differently react native array prototype

I am trying to sort array of objects based on an integer property. When using lodash's method _.sortBy() the order is as expected but when I use the built in method it isn't right.

Check the snippet here: jsbin link. It's not the most readable example. I am not able to figure what is wrong with the sort method that I have written. The objects which have delay value 0 should maintain their original order in the array but that's not happening with the native sort method. Let me know in comments if I should edit my example for more clarity.

Answer:1

Here is fiddle and this is my code: $(document).ready(function(){ $( ".keywordsdiv" ).each(function(){ $(this).children(".keywords").eq(3).after('<a href="" id="...

Here is fiddle and this is my code: $(document).ready(function(){ $( ".keywordsdiv" ).each(function(){ $(this).children(".keywords").eq(3).after('<a href="" id="...

I tryed to mark text with js, i select text and then hit button that wrap the selected area with span tag - but if i select area that half of it have style, it's remove the style from the selected ...

I tryed to mark text with js, i select text and then hit button that wrap the selected area with span tag - but if i select area that half of it have style, it's remove the style from the selected ...

var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); var rect = {}; var drag = false; make_base(); init(); function make_base() { base_image = new ...

var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); var rect = {}; var drag = false; make_base(); init(); function make_base() { base_image = new ...

I have this code <span id="signinButton" class="g-signin" data-callback="signinCallback" data-clientid="...

I have this code <span id="signinButton" class="g-signin" data-callback="signinCallback" data-clientid="...