js sort中的排序是否受环境影响,比如Android和ios中是否出现顺序不一致.
假如: let arr = [ {nid:3,name:“张三”}, {nid:2,name:“李四”}, {nid:2,name:“王五”} ]; arr.sort((a,b)=>{ return a.nid -b.nid });
运算结果: 是否任何环境下的结果都是: [ {nid:2,name:“李四”}, {nid:2,name:“王五”}, {nid:3,name:“张三”}, ]; 问题? 有没可能出现: [ {nid:2,name:“王五”}, {nid:2,name:“李四”}, {nid:3,name:“张三”}, ];