const array = [{name:'Suzanne'},{name:'Jim'},{name:'Trevor'},{name:'Amanda'}];
array.sort((a,b)=>a.name > b.name);
I am attempting to sort the objects in my array alphabetically by name, from A to Z. The code works perfectly when executed in node(v8.4.0) and Safari's development console.
However, there seems to be an issue with getting it to work in Chrome's development console (v70.0.3538.110). When I try to run the code in Chrome, the result is not as expected.
As far as I can tell, the code itself should be correct. I'm unsure why it's not functioning correctly in Chrome and would appreciate any insight into this matter.